From 945ac0847ae81a900842c4d8d78496085137a8ab Mon Sep 17 00:00:00 2001 From: Forrest-Flowers Date: Wed, 3 Oct 2018 20:55:52 -0500 Subject: [PATCH 1/6] initial commit --- textGame/Program.cs | 12 ++++++++++++ textGame/textGame.csproj | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 textGame/Program.cs create mode 100644 textGame/textGame.csproj diff --git a/textGame/Program.cs b/textGame/Program.cs new file mode 100644 index 00000000..4790f1f1 --- /dev/null +++ b/textGame/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace textGame +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} 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 + + + From f64a5aa177e8ff09c30d7727ae36554a1e63d777 Mon Sep 17 00:00:00 2001 From: Forrest-Flowers Date: Mon, 8 Oct 2018 19:32:07 -0500 Subject: [PATCH 2/6] Mostly done with the Practice, started the Text Game --- week1-practice/Program.cs | 38 ++++++++++++++++++++++++++++ week1-practice/week1-practice.csproj | 9 +++++++ 2 files changed, 47 insertions(+) create mode 100644 week1-practice/Program.cs create mode 100644 week1-practice/week1-practice.csproj diff --git a/week1-practice/Program.cs b/week1-practice/Program.cs new file mode 100644 index 00000000..141ff87b --- /dev/null +++ b/week1-practice/Program.cs @@ -0,0 +1,38 @@ +using System; + +namespace week1_practice +{ + class Program + { + static void Main(string[] args) + { int num1; + int num2; + int total; + + Console.WriteLine("Please enter an integer you would like to add:"); + num1 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("And the second integer:"); + num2 = Convert.ToInt32(Console.ReadLine()); + total = num1 + num2; + + Console.WriteLine("{0} + {1} = {2}", num1, num2, total); + + string name = "John"; + + name.ToUpper(); + Console.WriteLine(name.ToUpper()); + + bool People = true; + var f = false; + var num = 1.7; + Console.WriteLine(num * num); + + // string firstName = "Forrest"; + // string lastName= "Flowers"; + // string age = "19"; + // string job = "Amateur Developer"; + // string favoriteBand = "Streetlight Manifesto"; + // string favoriteSportsTeam = "N/A"; + } + } +} 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 + + + From d5fc79234e12457315b96701fe644ddcb2474c72 Mon Sep 17 00:00:00 2001 From: Forrest-Flowers Date: Wed, 10 Oct 2018 00:16:23 -0500 Subject: [PATCH 3/6] Finished up Practice. --- week1-practice/Program.cs | 47 ++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/week1-practice/Program.cs b/week1-practice/Program.cs index 141ff87b..43b7c1c6 100644 --- a/week1-practice/Program.cs +++ b/week1-practice/Program.cs @@ -5,34 +5,61 @@ namespace week1_practice class Program { static void Main(string[] args) - { int num1; + { // 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); - string name = "John"; + //End of adding program. + - name.ToUpper(); - Console.WriteLine(name.ToUpper()); + // 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; - var num = 1.7; + + // Take var num and multiply it by itself. + var num = 1.7m; Console.WriteLine(num * num); + // Make var num an integer. + int intnum = Convert.ToInt32(num); + Console.WriteLine(intnum); - // string firstName = "Forrest"; - // string lastName= "Flowers"; - // string age = "19"; - // string job = "Amateur Developer"; - // string favoriteBand = "Streetlight Manifesto"; + //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); + } } } From 898b071d700deec1b64642642db8bf8720c11877 Mon Sep 17 00:00:00 2001 From: Forrest-Flowers Date: Wed, 10 Oct 2018 17:51:33 -0500 Subject: [PATCH 4/6] Started textGame --- textGame/Program.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/textGame/Program.cs b/textGame/Program.cs index 4790f1f1..03847b36 100644 --- a/textGame/Program.cs +++ b/textGame/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; namespace textGame { @@ -6,7 +7,20 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Console.WriteLine("Welcome to the cavern of secrets!"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Thread.Sleep(2000); + + bool ch1; + bool stick = false; + String yes = + + 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)"); + Console.ReadLine(); + + if () } } } From b4ab184292fe6eb0f3572b91c1648c3a65a6458e Mon Sep 17 00:00:00 2001 From: Forrest-Flowers Date: Wed, 10 Oct 2018 18:44:30 -0500 Subject: [PATCH 5/6] got to beginning of spider fight in text game --- textGame/Program.cs | 19 ++++++++++++++----- week1-practice/Program.cs | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/textGame/Program.cs b/textGame/Program.cs index 03847b36..62afadbc 100644 --- a/textGame/Program.cs +++ b/textGame/Program.cs @@ -12,15 +12,24 @@ static void Main(string[] args) Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Thread.Sleep(2000); - bool ch1; + String ch1; bool stick = false; - String yes = 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)"); - Console.ReadLine(); - - if () + 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; + } + } } } diff --git a/week1-practice/Program.cs b/week1-practice/Program.cs index 43b7c1c6..5bfc34d0 100644 --- a/week1-practice/Program.cs +++ b/week1-practice/Program.cs @@ -37,7 +37,7 @@ static void Main(string[] args) var f = false; // Take var num and multiply it by itself. - var num = 1.7m; + decimal num = 1.49m; Console.WriteLine(num * num); // Make var num an integer. int intnum = Convert.ToInt32(num); From f8945276f9b70885dd0a49ba17e31da42bb9ae07 Mon Sep 17 00:00:00 2001 From: Forrest-Flowers Date: Mon, 15 Oct 2018 17:53:41 -0500 Subject: [PATCH 6/6] textgame finished --- textGame/Program.cs | 112 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 2 deletions(-) diff --git a/textGame/Program.cs b/textGame/Program.cs index 62afadbc..aa3f510e 100644 --- a/textGame/Program.cs +++ b/textGame/Program.cs @@ -1,6 +1,7 @@ using System; using System.Threading; + namespace textGame { class Program @@ -13,23 +14,130 @@ static void Main(string[] args) 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)"); + 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{ + 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; + } + } } } +