From f2c7f83b4ed80851244e6bd2e24577318a59ba99 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Mon, 7 Jan 2019 19:38:59 -0600 Subject: [PATCH 01/21] Saying hello to myself --- HelloWorld/HelloWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HelloWorld/HelloWorld.cs b/HelloWorld/HelloWorld.cs index 8168c805..ebf34321 100644 --- a/HelloWorld/HelloWorld.cs +++ b/HelloWorld/HelloWorld.cs @@ -6,7 +6,7 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + Console.WriteLine("Hello Chase!"); } } } From aec1f270d1faa3a397e16f414f1c69f5a98109d5 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Mon, 7 Jan 2019 20:57:09 -0600 Subject: [PATCH 02/21] saying hello to myself --- HelloWorld/HelloWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HelloWorld/HelloWorld.cs b/HelloWorld/HelloWorld.cs index ebf34321..8168c805 100644 --- a/HelloWorld/HelloWorld.cs +++ b/HelloWorld/HelloWorld.cs @@ -6,7 +6,7 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello Chase!"); + Console.WriteLine("Hello World!"); } } } From 2e6ad27f6ec22c25147b5373c038714749523288 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Mon, 7 Jan 2019 20:59:04 -0600 Subject: [PATCH 03/21] changed name --- HelloWorld/HelloWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HelloWorld/HelloWorld.cs b/HelloWorld/HelloWorld.cs index 8168c805..ebf34321 100644 --- a/HelloWorld/HelloWorld.cs +++ b/HelloWorld/HelloWorld.cs @@ -6,7 +6,7 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + Console.WriteLine("Hello Chase!"); } } } From d8c435f588b0097be446c7db50a1b353f7ef32b0 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 9 Jan 2019 11:41:42 -0600 Subject: [PATCH 04/21] finished homework project --- HelloWorld/HomeworkWeek1Lesson1.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 HelloWorld/HomeworkWeek1Lesson1.cs diff --git a/HelloWorld/HomeworkWeek1Lesson1.cs b/HelloWorld/HomeworkWeek1Lesson1.cs new file mode 100644 index 00000000..bda7abb4 --- /dev/null +++ b/HelloWorld/HomeworkWeek1Lesson1.cs @@ -0,0 +1,17 @@ +using System; + +public class Program +{ + public static void Main() + { + string name = ""; + int age = 0; + int presidentAge = 35; + + Console.WriteLine("Please enter your full name: "); + name = Console.ReadLine(); + Console.WriteLine("Please enter your age: "); + age = Convert.ToInt32(Console.ReadLine()); + + Console.WriteLine("My fellow Americans, my name is {0} and I am {1} years old. I am running for presidency in {2} years.", name, age, presidentAge-age); } +} \ No newline at end of file From 443c4863b43e4434373d379333fd504e8d2a16fd Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 9 Jan 2019 20:20:02 -0600 Subject: [PATCH 05/21] classwork --- HelloWorld/PersonalInfo.cs | 17 +++++++++++++++++ HelloWorld/YardsToInches.cs | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 HelloWorld/PersonalInfo.cs create mode 100644 HelloWorld/YardsToInches.cs diff --git a/HelloWorld/PersonalInfo.cs b/HelloWorld/PersonalInfo.cs new file mode 100644 index 00000000..654c647d --- /dev/null +++ b/HelloWorld/PersonalInfo.cs @@ -0,0 +1,17 @@ +using System; + +public class Program +{ + public static void Main() + { + string firstName = "Chase "; + string lastName = "Woods "; + int age = 29; + string job = "Lyft Driver"; + string favoriteBand = "Animals As Leaders "; + string favoriteSportsTeam = "Dallas Cowboys "; + + Console.WriteLine("Hello my name is" + firstName + lastName + "I am " + age + "years old and am a " + job + ". My favorite band is" My Favorite band is " + favoriteBand + "They are awesome. My favorite team is the " + favoriteSportsTeam + "I hope they win the Super Bowl." ) + + } +} \ No newline at end of file diff --git a/HelloWorld/YardsToInches.cs b/HelloWorld/YardsToInches.cs new file mode 100644 index 00000000..67f487ed --- /dev/null +++ b/HelloWorld/YardsToInches.cs @@ -0,0 +1,20 @@ +using System; + +public class Program +{ + public static void Main() + { + bool people = true; + bool f = false; + string YardsInput; + + Console.WriteLine("How many Yards?"); + YardsInput = Console.ReadLine(); + + int Yards = Convert.ToInt32(YardsInput); + int Inches = (Yards * 36); + + Console.WriteLine("There are " + Inches + " inches in " + Yards + " Yards."); + + } +} \ No newline at end of file From af08c2fad53b11efeaa8f467bca70099ff65ec3e Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 9 Jan 2019 20:35:56 -0600 Subject: [PATCH 06/21] created new files for textbasedgame --- TextBasedGame/TextBasedGame.cs | 12 ++++++++++++ TextBasedGame/TextBasedGame.csproj | 0 2 files changed, 12 insertions(+) create mode 100644 TextBasedGame/TextBasedGame.cs create mode 100644 TextBasedGame/TextBasedGame.csproj diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs new file mode 100644 index 00000000..5d9b896c --- /dev/null +++ b/TextBasedGame/TextBasedGame.cs @@ -0,0 +1,12 @@ +using System; + +public class Program +{ + public static void Main() + { + + + + + } +} \ No newline at end of file diff --git a/TextBasedGame/TextBasedGame.csproj b/TextBasedGame/TextBasedGame.csproj new file mode 100644 index 00000000..e69de29b From af5e7acc912d9abd99e5d13d163bcfc119a1ef0b Mon Sep 17 00:00:00 2001 From: Jacqueline Byrne Date: Mon, 14 Jan 2019 19:22:05 -0600 Subject: [PATCH 07/21] testing git clone and making sure everything works --- textBasedGame/textBasedGame.cs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 textBasedGame/textBasedGame.cs diff --git a/textBasedGame/textBasedGame.cs b/textBasedGame/textBasedGame.cs new file mode 100644 index 00000000..417caab0 --- /dev/null +++ b/textBasedGame/textBasedGame.cs @@ -0,0 +1,2 @@ +using System; + From 1487d61bc7738569918b5d54c8969313d14117cc Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 15:21:27 -0600 Subject: [PATCH 08/21] Got a couple more segments finished up until seeing spider --- TextBasedGame/TextBasedGame.cs | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs index 5d9b896c..45af49e2 100644 --- a/TextBasedGame/TextBasedGame.cs +++ b/TextBasedGame/TextBasedGame.cs @@ -4,9 +4,34 @@ public class Program { public static void Main() { - - - - + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Console.WriteLine("Welcome To The Cavern Of Secrets"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + + Console.WriteLine("You enter a dark cavern out of curiousity. It is dark, but you can make out the shape of a stick on the ground in front of you. Do you take it? (yes or no?)"); + string StickInput = ""; + string SpiderInput = ""; + StickInput = Console.ReadLine(); + + string[]options = new string[4]; + options[0] = "y"; + options[1] = "Y"; + options[2] = "yes"; + options[3] = "Yes"; + + if (Array.IndexOf(options,StickInput) >=0) + Console.WriteLine("You got the stick!"); + else + Console.WriteLine("You left the stick behind."); + + Console.WriteLine("Further into the cavern you spot something glowing in the distance do you approach it? (yes/no)"); + SpiderInput = Console.ReadLine(); + + if (Array.IndexOf(options,SpiderInput) >=0) + Console.WriteLine("As you approach the glowing figure it starts to move towards you slowly."); + + else (Array.LastIndexOf(options,SpiderInput) <0); + Console.WriteLine("As you move away from the glowing figure, you can see it move quickly towards you."); + } } \ No newline at end of file From e96109147db5e5a876ea73b82c8bf8c40bfb1c18 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 15:38:44 -0600 Subject: [PATCH 09/21] Fixed spider encounter, need to finish battle system --- TextBasedGame/TextBasedGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs index 45af49e2..b0f468c0 100644 --- a/TextBasedGame/TextBasedGame.cs +++ b/TextBasedGame/TextBasedGame.cs @@ -30,7 +30,7 @@ public static void Main() if (Array.IndexOf(options,SpiderInput) >=0) Console.WriteLine("As you approach the glowing figure it starts to move towards you slowly."); - else (Array.LastIndexOf(options,SpiderInput) <0); + else Console.WriteLine("As you move away from the glowing figure, you can see it move quickly towards you."); } From 4325b3ae8ad19ab0beae71e0286a78f0c5a4fee5 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 17:17:44 -0600 Subject: [PATCH 10/21] Everything but the actual random integer --- TextBasedGame/TextBasedGame.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs index b0f468c0..9b22f2c7 100644 --- a/TextBasedGame/TextBasedGame.cs +++ b/TextBasedGame/TextBasedGame.cs @@ -33,5 +33,23 @@ public static void Main() else Console.WriteLine("As you move away from the glowing figure, you can see it move quickly towards you."); + Console.WriteLine("Your attention is drawn to the glowing figure which you now see clearly is a spider!"); + Console.WriteLine("The spider is directly coming towards you with its fangs drawn. Do you attack it? (yes/no)"); + FightInput = Console.ReadLine(); + + if (Array.IndexOf(options,FightInput) <0); + Console.WriteLine("You turn to run out of the cave and lose your way in the darkness. The spider sinks its fangs into you as everything goes black."); + Console.WriteLine("Better luck next time!"); + + + else + { + if (Array.IndexOf(options,StickInput) >=0); + Console.WriteLine("You attack the spider with the stick!"); + + else + Console.WriteLine("You attack the spider with your barehands!"); + } + } } \ No newline at end of file From 1750b3fdf1cef3270feeb8a648c8ab8f3673a65c Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 17:37:16 -0600 Subject: [PATCH 11/21] made a ton of changed but keep getting errors on semi-colons. --- TextBasedGame/TextBasedGame.cs | 41 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs index 9b22f2c7..c0a31e5f 100644 --- a/TextBasedGame/TextBasedGame.cs +++ b/TextBasedGame/TextBasedGame.cs @@ -5,13 +5,13 @@ public class Program public static void Main() { Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); - Console.WriteLine("Welcome To The Cavern Of Secrets"); + Console.WriteLine(" Welcome To The Cavern Of Secrets"); Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Console.WriteLine("You enter a dark cavern out of curiousity. It is dark, but you can make out the shape of a stick on the ground in front of you. Do you take it? (yes or no?)"); - string StickInput = ""; - string SpiderInput = ""; - StickInput = Console.ReadLine(); + string StickInput = ""; + string SpiderInput = ""; + StickInput = Console.ReadLine(); string[]options = new string[4]; options[0] = "y"; @@ -31,25 +31,30 @@ public static void Main() Console.WriteLine("As you approach the glowing figure it starts to move towards you slowly."); else - Console.WriteLine("As you move away from the glowing figure, you can see it move quickly towards you."); + Console.WriteLine("As you move away from the glowing figure, you can see it move quickly towards you."); Console.WriteLine("Your attention is drawn to the glowing figure which you now see clearly is a spider!"); Console.WriteLine("The spider is directly coming towards you with its fangs drawn. Do you attack it? (yes/no)"); - FightInput = Console.ReadLine(); + + string FightInput = Console.ReadLine(); if (Array.IndexOf(options,FightInput) <0); - Console.WriteLine("You turn to run out of the cave and lose your way in the darkness. The spider sinks its fangs into you as everything goes black."); - Console.WriteLine("Better luck next time!"); - - - else - { - if (Array.IndexOf(options,StickInput) >=0); + { Console.WriteLine("You turn to run out of the cave and lose your way in the darkness. The spider sinks its fangs into you as everything goes black."); + Console.WriteLine("Better luch next time."); + + + else + { + if (Array.IndexOf(options,StickInput) >=0); Console.WriteLine("You attack the spider with the stick!"); - - else + Console.WriteLine("After striking the spider, it runs back off into the distance as you run out of the cave."); + Console.WriteLine("You have escaped the cave unscathed, Congratulations!"); + + else Console.WriteLine("You attack the spider with your barehands!"); + Console.WriteLine("You strike the spider with your fists and after a long tussle, you stun the spider long enough to stumble and run back to the entrance of the cave."); + Console.WriteLine("You have escaped the cave, but not without terrible injuries."); } - - } -} \ No newline at end of file + } + } + } \ No newline at end of file From a2891318f07b2c14b7504e69c9625e12d5451bdc Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 17:39:52 -0600 Subject: [PATCH 12/21] added csproj file --- TextBasedGame/TextBasedGame.csproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TextBasedGame/TextBasedGame.csproj b/TextBasedGame/TextBasedGame.csproj index e69de29b..f94b956a 100644 --- a/TextBasedGame/TextBasedGame.csproj +++ b/TextBasedGame/TextBasedGame.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.0 + + + \ No newline at end of file From ef1b8dcb9e9c2147c74fcd330bf76d25279d55f2 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 17:46:30 -0600 Subject: [PATCH 13/21] still attempting to fix errors --- TextBasedGame/TextBasedGame.cs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs index c0a31e5f..20a7efdf 100644 --- a/TextBasedGame/TextBasedGame.cs +++ b/TextBasedGame/TextBasedGame.cs @@ -10,7 +10,8 @@ public static void Main() Console.WriteLine("You enter a dark cavern out of curiousity. It is dark, but you can make out the shape of a stick on the ground in front of you. Do you take it? (yes or no?)"); string StickInput = ""; - string SpiderInput = ""; + string FightInput = ""; + string SpiderInput = ""; StickInput = Console.ReadLine(); string[]options = new string[4]; @@ -36,24 +37,24 @@ public static void Main() Console.WriteLine("Your attention is drawn to the glowing figure which you now see clearly is a spider!"); Console.WriteLine("The spider is directly coming towards you with its fangs drawn. Do you attack it? (yes/no)"); - string FightInput = Console.ReadLine(); + FightInput = Console.ReadLine(); - if (Array.IndexOf(options,FightInput) <0); + if (Array.IndexOf(options,FightInput) < 0); { Console.WriteLine("You turn to run out of the cave and lose your way in the darkness. The spider sinks its fangs into you as everything goes black."); Console.WriteLine("Better luch next time."); - else + else { - if (Array.IndexOf(options,StickInput) >=0); - Console.WriteLine("You attack the spider with the stick!"); - Console.WriteLine("After striking the spider, it runs back off into the distance as you run out of the cave."); - Console.WriteLine("You have escaped the cave unscathed, Congratulations!"); - - else - Console.WriteLine("You attack the spider with your barehands!"); - Console.WriteLine("You strike the spider with your fists and after a long tussle, you stun the spider long enough to stumble and run back to the entrance of the cave."); - Console.WriteLine("You have escaped the cave, but not without terrible injuries."); + if (Array.IndexOf(options,StickInput) >=0); + Console.WriteLine("You attack the spider with the stick!"); + Console.WriteLine("After striking the spider, it runs back off into the distance as you run out of the cave."); + Console.WriteLine("You have escaped the cave unscathed, Congratulations!"); + + else + Console.WriteLine("You attack the spider with your barehands!"); + Console.WriteLine("You strike the spider with your fists and after a long tussle, you stun the spider long enough to stumble and run back to the entrance of the cave."); + Console.WriteLine("You have escaped the cave, but not without terrible injuries."); } } } From 2549d2d0f0071d8208e2dcef0bba24bc3310cc1c Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 20:22:22 -0600 Subject: [PATCH 14/21] Finished textbasedgame, added a bit to RockPaperScissors --- RockPaperScissors/RockPaperScissors.cs | 29 ++++++++++++++++++++++---- TextBasedGame/TextBasedGame.cs | 15 ++++++------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/RockPaperScissors/RockPaperScissors.cs b/RockPaperScissors/RockPaperScissors.cs index 470ae756..82ac9a16 100644 --- a/RockPaperScissors/RockPaperScissors.cs +++ b/RockPaperScissors/RockPaperScissors.cs @@ -2,10 +2,12 @@ namespace RockPaperScissors { - class Program + public class Program { public static void Main() { + int score = 0; + Console.WriteLine("Enter hand 1:"); string hand1 = Console.ReadLine().ToLower(); Console.WriteLine("Enter hand 2:"); @@ -18,8 +20,27 @@ public static void Main() public static string CompareHands(string hand1, string hand2) { - // Your code here - return hand1 + ' ' + hand2; + if (hand1==hand2){ + return "It's a tie.";} + + + else if (hand1 == "rock" && hand2 == "scissors"){ + return "Hand 1 Wins!!!"; + } + + else if (hand1 == "scissors" && hand2 == "paper"){ + return "Hand 1 Wins!!!"; + } + + else if (hand1 == "paper" && hand2 == "rock"){ + return "Hand 1 wins!!!"; + + } + + else { + return "Hand 1 Loses!!!";} + + } } -} +} \ No newline at end of file diff --git a/TextBasedGame/TextBasedGame.cs b/TextBasedGame/TextBasedGame.cs index 20a7efdf..6f72e05c 100644 --- a/TextBasedGame/TextBasedGame.cs +++ b/TextBasedGame/TextBasedGame.cs @@ -39,23 +39,24 @@ public static void Main() FightInput = Console.ReadLine(); - if (Array.IndexOf(options,FightInput) < 0); + if (Array.IndexOf(options,FightInput) < 0) { Console.WriteLine("You turn to run out of the cave and lose your way in the darkness. The spider sinks its fangs into you as everything goes black."); Console.WriteLine("Better luch next time."); - + } else { - if (Array.IndexOf(options,StickInput) >=0); + if (Array.IndexOf(options,StickInput) >=0) Console.WriteLine("You attack the spider with the stick!"); Console.WriteLine("After striking the spider, it runs back off into the distance as you run out of the cave."); Console.WriteLine("You have escaped the cave unscathed, Congratulations!"); - - else + } + { + else Console.WriteLine("You attack the spider with your barehands!"); Console.WriteLine("You strike the spider with your fists and after a long tussle, you stun the spider long enough to stumble and run back to the entrance of the cave."); Console.WriteLine("You have escaped the cave, but not without terrible injuries."); + } } } - } - } \ No newline at end of file + From 2eba0f679e0e324e30e3f4bd5d171948c4a1d061 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 16 Jan 2019 20:47:38 -0600 Subject: [PATCH 15/21] rockpaperscissors --- RockPaperScissors/RockPaperScissors.cs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/RockPaperScissors/RockPaperScissors.cs b/RockPaperScissors/RockPaperScissors.cs index 82ac9a16..8d9c3e88 100644 --- a/RockPaperScissors/RockPaperScissors.cs +++ b/RockPaperScissors/RockPaperScissors.cs @@ -6,13 +6,27 @@ public class Program { public static void Main() { - int score = 0; + int scoreOne = 0; + int scoreTwo = 0; Console.WriteLine("Enter hand 1:"); string hand1 = Console.ReadLine().ToLower(); Console.WriteLine("Enter hand 2:"); string hand2 = Console.ReadLine().ToLower(); - Console.WriteLine(CompareHands(hand1, hand2)); + string winner = (CompareHands(hand1, hand2)); + string[] winnerSep = winner.Split("*"); + string winnerText = winnerSep[0]; + int winnerAdd = Convert.ToInt32(winnerText); + + if (winnerAdd == 1){ + scoreOne++; + } + + else if (winnerAdd == 2){ + scoreTwo++; + } + Console.WriteLine(winnerText); + Console.WriteLine("The score is " + scoreOne + "to " + scoreTwo); // leave this command at the end so your program does not close automatically Console.ReadLine(); @@ -25,20 +39,20 @@ public static string CompareHands(string hand1, string hand2) else if (hand1 == "rock" && hand2 == "scissors"){ - return "Hand 1 Wins!!!"; + return "Hand 1 Wins!!!*1"; } else if (hand1 == "scissors" && hand2 == "paper"){ - return "Hand 1 Wins!!!"; + return "Hand 1 Wins!!!*1"; } else if (hand1 == "paper" && hand2 == "rock"){ - return "Hand 1 wins!!!"; + return "Hand 1 Wins!!!*1"; } else { - return "Hand 1 Loses!!!";} + return "Hand 1 Loses!!!*2";} } From 17155b757c1e67a21aa27379a1a17e1f2c5a0ca0 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Mon, 21 Jan 2019 20:19:59 -0600 Subject: [PATCH 16/21] Finished win conditions for TicTacToe --- TicTacToe/TicTacToe.cs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index c5751176..2aba9da5 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -12,6 +12,7 @@ class Program new string[] {" ", " ", " "} }; + public static void Main() { do @@ -32,6 +33,9 @@ public static void GetInput() int row = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Column:"); int column = int.Parse(Console.ReadLine()); + playerTurn = (playerTurn == "X") ? "O" : "X"; + + return; } public static void PlaceMark(int row, int column) @@ -48,30 +52,34 @@ public static bool CheckForWin() public static bool CheckForTie() { - // your code goes here + return false; } public static bool HorizontalWin() { - // your code goes here - + return (board[0][0] == playerTurn && board[0][1] == playerTurn && board[0][2] == playerTurn); + return (board[1][0] == playerTurn && board[1][1] == playerTurn && board[1][2] == playerTurn); + return (board[2][0] == playerTurn && board[2][1] == playerTurn && board[2][2] == playerTurn); return false; } public static bool VerticalWin() { - // your code goes here + return (board[0][0] == playerTurn && board[1][0] == playerTurn && board[2][0] == playerTurn); + return (board[0][1] == playerTurn && board[1][1] == playerTurn && board[2][1] == playerTurn); + return (board[0][2] == playerTurn && board[1][2] == playerTurn && board[2][2] == playerTurn); - return false; + return false; } public static bool DiagonalWin() { - // your code goes here + return (board[0][0] == playerTurn && board[1][1] == playerTurn && board[2][2] == playerTurn); + return (board[0][2] == playerTurn && board[1][1] == playerTurn && board[2][0] == playerTurn); - return false; + return false; } public static void DrawBoard() From 769a21416180c6e4f8671ce8209462f57452ab4d Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Mon, 21 Jan 2019 20:43:30 -0600 Subject: [PATCH 17/21] started marking on the board, playerturn now set up --- TicTacToe/TicTacToe.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index 2aba9da5..c54efd52 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -34,13 +34,19 @@ public static void GetInput() Console.WriteLine("Enter Column:"); int column = int.Parse(Console.ReadLine()); playerTurn = (playerTurn == "X") ? "O" : "X"; + PlaceMark(row,column); return; } public static void PlaceMark(int row, int column) { - // your code goes here + if (string.IsNullOrWhiteSpace(board[row][column])){ + Console.WriteLine(playerTurn); + } + else + Console.WriteLine("Sorry that space is taken!"); + } public static bool CheckForWin() From ff57fde28b9af1423e869b7c802df8f113fa76cf Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Mon, 21 Jan 2019 20:53:22 -0600 Subject: [PATCH 18/21] fixing logic issues within PlaceMark --- TicTacToe/TicTacToe.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index c54efd52..267f42f7 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -42,7 +42,7 @@ public static void GetInput() public static void PlaceMark(int row, int column) { if (string.IsNullOrWhiteSpace(board[row][column])){ - Console.WriteLine(playerTurn); + playerTurn; } else Console.WriteLine("Sorry that space is taken!"); From 4583f890c94d6cc51cab72f7b81f3a225a581d5e Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 23 Jan 2019 16:13:35 -0600 Subject: [PATCH 19/21] Finished FizzBuzz --- FizzBuzz/FizzBuzz.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/FizzBuzz/FizzBuzz.cs b/FizzBuzz/FizzBuzz.cs index 9246f703..41cf93cf 100644 --- a/FizzBuzz/FizzBuzz.cs +++ b/FizzBuzz/FizzBuzz.cs @@ -6,7 +6,21 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + for (int i = 0; i < 101; i++) + { + if (i/15 = true) { + Console.WriteLine("FIZZBUZZ"); + } + else if (i/5 = true) { + Console.WriteLine("BUZZ"); + } + else if (i/3 = true) { + Console.WriteLine("FIZZ"); + } + else { + Console.WriteLine(i); + } + } } } } From d49c612dd1c6d5168e358aa01c1fc02c21d06a50 Mon Sep 17 00:00:00 2001 From: Chasewoods89 Date: Wed, 23 Jan 2019 16:22:07 -0600 Subject: [PATCH 20/21] actually finished FizzBuzz --- FizzBuzz/FizzBuzz.cs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/FizzBuzz/FizzBuzz.cs b/FizzBuzz/FizzBuzz.cs index 41cf93cf..755afdc6 100644 --- a/FizzBuzz/FizzBuzz.cs +++ b/FizzBuzz/FizzBuzz.cs @@ -6,21 +6,25 @@ class Program { static void Main(string[] args) { - for (int i = 0; i < 101; i++) + for (int i = 1; i <= 100; i++) { - if (i/15 = true) { - Console.WriteLine("FIZZBUZZ"); - } - else if (i/5 = true) { - Console.WriteLine("BUZZ"); - } - else if (i/3 = true) { - Console.WriteLine("FIZZ"); - } - else { - Console.WriteLine(i); - } - } + if (i % 3 == 0 && i % 5 == 0) + { + Console.WriteLine("FizzBuzz"); + } + else if (i % 3 == 0) + { + Console.WriteLine("Fizz"); + } + else if (i % 5 == 0) + { + Console.WriteLine("Buzz"); + } + else + { + Console.WriteLine(i); + } + } } } } From 8f02cb5cb415ec52a07d27981ac8e59915a6a670 Mon Sep 17 00:00:00 2001 From: Jacqueline Byrne Date: Mon, 28 Jan 2019 18:27:49 -0600 Subject: [PATCH 21/21] had a few checkpoint things to commit --- Checkpoint1/.vscode/launch.json | 28 ++++++++++++ Checkpoint1/.vscode/tasks.json | 15 +++++++ Checkpoint1/Checkpoint1.cs | 75 ++++++++++++++++++++++++++++++++- TicTacToe/.vscode/launch.json | 28 ++++++++++++ TicTacToe/.vscode/tasks.json | 15 +++++++ 5 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 Checkpoint1/.vscode/launch.json create mode 100644 Checkpoint1/.vscode/tasks.json create mode 100644 TicTacToe/.vscode/launch.json create mode 100644 TicTacToe/.vscode/tasks.json diff --git a/Checkpoint1/.vscode/launch.json b/Checkpoint1/.vscode/launch.json new file mode 100644 index 00000000..bb71d335 --- /dev/null +++ b/Checkpoint1/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/Checkpoint1.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ,] +} \ No newline at end of file diff --git a/Checkpoint1/.vscode/tasks.json b/Checkpoint1/.vscode/tasks.json new file mode 100644 index 00000000..65947bdb --- /dev/null +++ b/Checkpoint1/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Checkpoint1.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Checkpoint1/Checkpoint1.cs b/Checkpoint1/Checkpoint1.cs index b7ed8611..bbea7907 100644 --- a/Checkpoint1/Checkpoint1.cs +++ b/Checkpoint1/Checkpoint1.cs @@ -4,9 +4,80 @@ namespace Checkpoint1 { class Program { - static void Main(string[] args) + static void Main() { - Console.WriteLine("Hello World!"); + Console.WriteLine("~~~~~~~~~~~~~~~Application 1~~~~~~~~~~~~~~~"); + Console.WriteLine(100 / 3); + + Console.WriteLine("~~~~~~~~~~~~~~~Application 2~~~~~~~~~~~~~~~"); + Console.WriteLine("Please enter a number:"); + int firstInput = int.Parse(Console.ReadLine()); + Console.WriteLine("Please enter another number:"); + int secondInput = int.Parse(Console.ReadLine()); + Console.WriteLine("Please enter a final number:"); + int thirdInput = int.Parse(Console.ReadLine()); + if ((firstInput + secondInput + thirdInput) == 666){ + Console.WriteLine("Your number is 666. HAIL SATAN!!!"); + } + else{ + Console.WriteLine("Your number is " + (firstInput + secondInput + thirdInput)); + } + + + + Console.WriteLine("~~~~~~~~~~~~~~~Application 3~~~~~~~~~~~~~~~"); + Console.WriteLine("Please enter the number you wish to factorize"); + int number = int.Parse(Console.ReadLine()); + Console.WriteLine("The number you entered was {0} and it's factorial is {1}", number, Factorial(number)); + + + Console.WriteLine("~~~~~~~~~~~~~~~Application 4~~~~~~~~~~~~~~~"); + Random rnd= new Random(); + int rndnumber = rnd.Next(1,11); + Console.WriteLine("I'm thinking of a number 1 through 10. Take a guess:"); + int userGuessOne = int.Parse(Console.ReadLine()); + if (rndnumber == userGuessOne){ + Console.WriteLine("Wow, you got it on the first try! Way to go!"); + } + else { + Console.WriteLine("Not the one, I'm thinking of. Try again!"); + } + int userGuessTwo = int.Parse(Console.ReadLine()); + if (rndnumber == userGuessTwo){ + Console.WriteLine("Good job! Way to get it right!"); + } + else { + Console.WriteLine("Missed again, give it another shot!"); + } + int userGuessThree = int.Parse(Console.ReadLine()); + if (rndnumber == userGuessThree){ + Console.WriteLine("Third time is the charm! Way To Go!"); + } + else { + Console.WriteLine("Missed three shots in a row huh? Give it ONE more try!"); + } + int userGuessFour = int.Parse(Console.ReadLine()); + if (rndnumber == userGuessFour){ + Console.WriteLine("I knew you would come through in the end. Great job!"); + } + else { + Console.WriteLine("Well...you miss 100% of the shots you don't take."); + } + + Console.WriteLine("~~~~~~~~~~~~~~~Application 5~~~~~~~~~~~~~~~"); + Console.WriteLine("Enter a set of numbers separated by a comma (,). Use as many as you'd like!"); + + + + + Console.ReadKey(true); + } + + static int Factorial(int n) + { + if (n >= 2) return n * Factorial(n - 1); + return 1; + } } } diff --git a/TicTacToe/.vscode/launch.json b/TicTacToe/.vscode/launch.json new file mode 100644 index 00000000..b35dd83d --- /dev/null +++ b/TicTacToe/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/TicTacToe.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ,] +} \ No newline at end of file diff --git a/TicTacToe/.vscode/tasks.json b/TicTacToe/.vscode/tasks.json new file mode 100644 index 00000000..a6ea07f7 --- /dev/null +++ b/TicTacToe/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/TicTacToe.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file