diff --git a/textGame/Program.cs b/textGame/Program.cs new file mode 100644 index 00000000..aa3f510e --- /dev/null +++ b/textGame/Program.cs @@ -0,0 +1,143 @@ +using System; +using System.Threading; + + +namespace textGame +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Console.WriteLine("Welcome to the cavern of secrets!"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Thread.Sleep(2000); + + String ch1; + String ch2; + String ch3; + bool stick = false; + + Console.WriteLine("You enter a dark cavern out of curiosity. It is dark and you can only make out a small stick on the floor."); + Console.WriteLine("Do you pick up the stick? [y/n]"); + ch1 = Console.ReadLine(); + + // STICK TAKEN + if (ch1 == "y" || ch1 == "Y" || ch1 == "Yes" || ch1 == "YES" || ch1 == "yes"){ + Console.WriteLine("You pick up the stick!"); + Thread.Sleep(2000); + stick = true; + }//STICK NOT TAKEN + else{ + Console.WriteLine("You pass up the Stick."); + Thread.Sleep(2000); + stick = false; + } + + Console.WriteLine("As you proceed further into the cave, you see a small glowing object"); + Console.WriteLine("Do you approach the object? [y/n]"); + ch2 = Console.ReadLine(); + + //FIGHT OR FLIGHT + if(ch2 == "y" || ch2 == "Y" || ch2 == "Yes" || ch2 == "YES" || ch2 == "yes"){ + Console.WriteLine("You approach the object..."); + Thread.Sleep(2000); + Console.WriteLine("As you draw closer, you begin to make out the object as an eye!"); + Thread.Sleep(1000); + Console.WriteLine("The eye belongs to a giant spider!"); + Console.WriteLine("Do you try to fight it? [Y/N]"); + ch3 = Console.ReadLine(); + + //FIGHT SPIDER + if(ch3 == "y" || ch3 == "Y" || ch3 == "Yes" || ch3 == "YES" || ch3 == "yes"){ + + //HAS A STICK + if(stick == true){ + Console.WriteLine("You only have a stick to fight with!"); + Console.WriteLine("You quickly jab the spider in it's eye to gain an advantage."); + Thread.Sleep(2000); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Console.WriteLine(" Fighting... "); + Console.WriteLine(" YOU MUST HIT ABOVE A 5 TO KILL THE SPIDER "); + Console.WriteLine("IF THE SPIDER HITS HIGHER THAN YOU, YOU WILL DIE"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + + int fdmg1; + int edmg1; + Random dmg = new Random(); + + + fdmg1 = dmg.Next(3, 11); + Console.WriteLine("You hit for {0} damage!", fdmg1); + + edmg1 = dmg.Next(1,6); + Console.WriteLine("The spider hits for {0} damage!", edmg1); + Console.ReadLine(); + + if(edmg1 > fdmg1){ + Console.WriteLine("The spider has done more damage than you!"); + return; + }else if(fdmg1 < 5){ + Console.WriteLine("You don't do enough damage to kill the spider, but you manage to wound it!"); + + return; + }else if(fdmg1 > 5){ + Console.WriteLine("You killed the spider!"); + + return; + } + + }// NOSTICK + else{ + Console.WriteLine("You don't have anything to fight with!"); + Thread.Sleep(2000); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Console.WriteLine(" Fighting... "); + Console.WriteLine(" YOU MUST HIT ABOVE A 5 TO KILL THE SPIDER "); + Console.WriteLine("IF THE SPIDER HITS HIGHER THAN YOU, YOU WILL DIE"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + + int fdmg0; + int edmg0; + Random dmg = new Random(); + + fdmg0 = dmg.Next(1, 9); + Console.WriteLine("You hit for {0} damage!", fdmg0); + + edmg0 = dmg.Next(1,6); + Console.WriteLine("The spider hits for {0} damage!", edmg0); + Console.ReadLine(); + if(edmg0 > fdmg0){ + Console.WriteLine("The spider has done more damage than you!"); + return; + + }else if(fdmg0 < 5){ + Console.WriteLine("You don't do enough damage to kill the spider, but you manage to wound it!"); + return; + }else if(fdmg0 > 5){ + Console.WriteLine("You killed the spider!"); + return; + } + + }//END NOSTICK FIGHT + + }//END FIGHT SPIDER + else{ + Console.WriteLine("You choose not to fight the spider."); + Thread.Sleep(1000); + Console.WriteLine("As you turn away, it ambushes you and impales you with it's fangs!!!"); + return; + } + + }//END FIGHT OR FLIGHT + else{ + Console.WriteLine("You turn away from the glowing object, and attempt to leave the cave..."); + Thread.Sleep(1000); + Console.WriteLine("But something won't let you...."); + return; + } + + } + } +} + diff --git a/textGame/textGame.csproj b/textGame/textGame.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/textGame/textGame.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + + diff --git a/week1-practice/Program.cs b/week1-practice/Program.cs new file mode 100644 index 00000000..5bfc34d0 --- /dev/null +++ b/week1-practice/Program.cs @@ -0,0 +1,65 @@ +using System; + +namespace week1_practice +{ + class Program + { + static void Main(string[] args) + { // ints for add function. + int num1; + int num2; + int total; + + // Write the first number in the problem + Console.WriteLine("Please enter an integer you would like to add:"); + num1 = Convert.ToInt32(Console.ReadLine()); + + // Write the second number. + Console.WriteLine("And the second integer:"); + num2 = Convert.ToInt32(Console.ReadLine()); + total = num1 + num2; + + //Let's add em up. + + Console.WriteLine("{0} + {1} = {2}", num1, num2, total); + + //End of adding program. + + + // The two ints we're working with. + int yards = 1; + int inches = yards * 36; + + // Converts yards to inches. Mission accomplished. + Console.WriteLine("{0} yard(s) is equal to {1} inches.", yards, inches); + + bool People = true; + var f = false; + + // Take var num and multiply it by itself. + decimal num = 1.49m; + Console.WriteLine(num * num); + // Make var num an integer. + int intnum = Convert.ToInt32(num); + Console.WriteLine(intnum); + + //Personal Info + string firstName = "Forrest"; + string lastName= "Flowers"; + string age = "19"; + string job = "Amateur Developer"; + string favoriteBand = "Streetlight Manifesto"; + // string favoriteSportsTeam = "N/A"; + + //Writes out my amazing introduction. + Console.WriteLine("Hi, my name is {0} {1} and I am {2} years old. I work as a {3}, and my favorite band is {4}.", firstName, lastName, age, job, favoriteBand); + + + Console.WriteLine(100 * 10); + Console.WriteLine(100 / 10); + Console.WriteLine(100 + 10); + Console.WriteLine(100 - 10); + + } + } +} diff --git a/week1-practice/week1-practice.csproj b/week1-practice/week1-practice.csproj new file mode 100644 index 00000000..fa9c42ee --- /dev/null +++ b/week1-practice/week1-practice.csproj @@ -0,0 +1,9 @@ + + + + Exe + netcoreapp2.1 + week1_practice + + +