From 22ccbc69489756f1a828cdaaa384170c89a54656 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Sat, 6 Oct 2018 11:01:55 -0500 Subject: [PATCH 01/11] finished week1 practice --- Week1-Practice/Program.cs | 51 ++++++++++++++++++++++++++++ Week1-Practice/Week1-Practice.csproj | 9 +++++ 2 files changed, 60 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..f5903523 --- /dev/null +++ b/Week1-Practice/Program.cs @@ -0,0 +1,51 @@ +using System; + +namespace Week1_Practice +{ + class Program + { + static void Main(string[] args) + { + int input1 = 0; + int input2 = 0; + + Console.WriteLine("Give me a number between 0 and 100:"); + input1 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Give me another number between 0 and 100:"); + input2 = Convert.ToInt32(Console.ReadLine()); + + Console.WriteLine(input1 + input2); + + int yardLength = 0; + int inchLength = 0; + Console.WriteLine("Give me a number of yards?"); + yardLength = Convert.ToInt32(Console.ReadLine()); + inchLength = (yardLength * 36); + + Console.WriteLine("You have {0} inches!", inchLength); + + bool people = true; + bool f = false; + decimal numb = 0.0M; + + + string firstName = "DeMarco"; + string lastName = "Spears"; + int age = 27; + string job = "Client Support Agent"; + string favoriteBand = "Beetles"; + string favoriteSportsTeam = "Golden State Warriors"; + + + Console.WriteLine("Give me a decimal number?"); + numb = Convert.ToDecimal(Console.ReadLine()); + Console.WriteLine(numb * numb); + Console.WriteLine("I love sports my favorite team is the {0}", favoriteSportsTeam); + Console.WriteLine("My birthday is on the forth of July, I'm {0} years old!", age); + Console.WriteLine("My favorite band of all time is the {0}!", favoriteBand); + Console.WriteLine("I work at Dell as a {0}!", job); + + } + } + +} diff --git a/Week1-Practice/Week1-Practice.csproj b/Week1-Practice/Week1-Practice.csproj new file mode 100644 index 00000000..b8c2678e --- /dev/null +++ b/Week1-Practice/Week1-Practice.csproj @@ -0,0 +1,9 @@ + + + + Exe + netcoreapp2.1 + Week1_Practice + + + From d8271b9287dcc7b28b64eb2e2553a3a1f71b1782 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Sun, 7 Oct 2018 22:18:07 -0500 Subject: [PATCH 02/11] textgame file added --- TextGame/TextGame.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 TextGame/TextGame.cs diff --git a/TextGame/TextGame.cs b/TextGame/TextGame.cs new file mode 100644 index 00000000..cb26e2c1 --- /dev/null +++ b/TextGame/TextGame.cs @@ -0,0 +1,18 @@ +musing System; +using threading; + +namespace TextGame +{ + + class Program + { + + public void Main(string[] args) + { + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Console.WriteLine("Welcome to the cavern of secrets!"); + Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + + } + } +} \ No newline at end of file From e11262739c429c1abcd0b6091fac436f01ebbb42 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Sun, 7 Oct 2018 22:22:14 -0500 Subject: [PATCH 03/11] file renamed --- TextGame/{TextGame.cs => Program.cs} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename TextGame/{TextGame.cs => Program.cs} (94%) diff --git a/TextGame/TextGame.cs b/TextGame/Program.cs similarity index 94% rename from TextGame/TextGame.cs rename to TextGame/Program.cs index cb26e2c1..2ad6914c 100644 --- a/TextGame/TextGame.cs +++ b/TextGame/Program.cs @@ -1,5 +1,5 @@ musing System; -using threading; +// using threading; namespace TextGame { From 2efd24f79bc6e2d9e43a8d53fcb47161e25369a9 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Mon, 8 Oct 2018 00:01:06 -0500 Subject: [PATCH 04/11] 1st attempt text game --- TextGame/Program.cs | 58 +++++++++++++++++++++++++++++++++++++--- TextGame/textgame.csproj | 8 ++++++ 2 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 TextGame/textgame.csproj diff --git a/TextGame/Program.cs b/TextGame/Program.cs index 2ad6914c..f36f44f5 100644 --- a/TextGame/Program.cs +++ b/TextGame/Program.cs @@ -1,5 +1,5 @@ -musing System; -// using threading; +using System; +using System.Threading; namespace TextGame { @@ -7,12 +7,62 @@ namespace TextGame class Program { - public void Main(string[] args) + static void Main(string[] args) { Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Console.WriteLine("Welcome to the cavern of secrets!"); Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Thread.Sleep(1000); + 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 take it? [y/n]: "); + string ch1 = Console.ReadLine(); + string ch2 = Console.ReadLine(); + string ch3 = Console.ReadLine(); + + int stick = 0; + if (ch1 == "y") + { + Console.WriteLine("You have taken the stick!"); + Thread.Sleep(2000); + stick = 1; + } + else + { + Console.WriteLine("You did not take the stick"); + stick = 0; + Console.WriteLine("As you proceed further into the cave, you see a small glowing object"); + + } + if (ch2 == "y") + { + 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(2000); + Console.WriteLine("The eye belongs to a giant spider!"); + Console.WriteLine("Do you try to fight it? [Y/N]"); + } + if (ch3 == "y") + { + if (stick == 1) + Console.WriteLine("You only have a stick to fight with!"); + Console.WriteLine("You quickly jab the spider in it's eye and 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("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + Thread.Sleep(2000); + // Random random = new Random(); + // int fdmg1 = Random.Next(3, 10); + // int edmg1 = Random.Next(1, 5); + Console.WriteLine("you hit a"); + Console.WriteLine("the spider hits a"); + Thread.Sleep(2000); + } + } } -} \ No newline at end of file +} 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 ff1c62b4b12f48870fcd03309b0a8c72004e15db Mon Sep 17 00:00:00 2001 From: DeMarco Date: Tue, 9 Oct 2018 22:04:21 -0500 Subject: [PATCH 05/11] updated text game --- TextGame/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TextGame/Program.cs b/TextGame/Program.cs index f36f44f5..eb04b169 100644 --- a/TextGame/Program.cs +++ b/TextGame/Program.cs @@ -54,9 +54,10 @@ static void Main(string[] args) Console.WriteLine("IF THE SPIDER HITS HIGHER THAN YOU, YOU WILL DIE"); Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Thread.Sleep(2000); - // Random random = new Random(); - // int fdmg1 = Random.Next(3, 10); - // int edmg1 = Random.Next(1, 5); + // Random randomNub = new Random(); + // int fdmg1 = Random.Next(3, 11); + // int edmg1 = Random.Next(1, 6); + //the random number gen will not display properly- im getting an error message Console.WriteLine("you hit a"); Console.WriteLine("the spider hits a"); Thread.Sleep(2000); From 44020df443780adf690546ed9943385799009c81 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Mon, 15 Oct 2018 20:30:59 -0500 Subject: [PATCH 06/11] intial tictactoe --- Quiz3/Program.cs | 26 ++++++++++++++++++++++++++ Quiz3/Quiz3.csproj | 8 ++++++++ TicTacToe/TicTacToe.cs | 6 ++++-- practice3/Program.cs | 37 +++++++++++++++++++++++++++++++++++++ practice3/practice3.csproj | 8 ++++++++ 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 Quiz3/Program.cs create mode 100644 Quiz3/Quiz3.csproj create mode 100644 practice3/Program.cs create mode 100644 practice3/practice3.csproj diff --git a/Quiz3/Program.cs b/Quiz3/Program.cs new file mode 100644 index 00000000..18b3b17c --- /dev/null +++ b/Quiz3/Program.cs @@ -0,0 +1,26 @@ +using System; + +namespace Quiz3 +{ + class Program + { + public static void Main(string[] args) + { + int firstNumb; + int sencondNumb; + Console.WriteLine("Please provide a number:"); + firstNumb = Convert.ToInt32(Console.ReadLine()); + sencondNumb = Convert.ToInt32(Console.ReadLine()); + + int sum = Addition(firstNumb + sencondNumb); + } + public static int Addition(int firstNumb , int sencondNumb) + { + + return firstNumb + sencondNumb; + + } + + } + +} diff --git a/Quiz3/Quiz3.csproj b/Quiz3/Quiz3.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/Quiz3/Quiz3.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + + diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index c5751176..a8693842 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -18,6 +18,7 @@ public static void Main() { DrawBoard(); GetInput(); + } while (!CheckForWin() && !CheckForTie()); @@ -25,7 +26,7 @@ public static void Main() Console.ReadLine(); } - public static void GetInput() + public static int GetInput(int row , int column ) { Console.WriteLine("Player " + playerTurn); Console.WriteLine("Enter Row:"); @@ -34,9 +35,10 @@ public static void GetInput() int column = int.Parse(Console.ReadLine()); } - public static void PlaceMark(int row, int column) + public static bool PlaceMark(int row, int column) { // your code goes here + //change to bool } public static bool CheckForWin() diff --git a/practice3/Program.cs b/practice3/Program.cs new file mode 100644 index 00000000..12f12a27 --- /dev/null +++ b/practice3/Program.cs @@ -0,0 +1,37 @@ +using System; + +namespace practice3 +{ + class Program + { + static void Main(string[] args) + { + String[] names = new String[4]; + //james + //mike + // adam + // jane + + name[0] = "james"; + nameo[1] = "mike"; + name[2] = "adam"; + name[3] = "jane"; + + String[] pets = { "Rocky","Walter", "Bailey"}; + String[] cities; + cities = new String[] {"Austin", "Dallas", "Houston"}; + + Console.WriteLine("In the array of size {0}, {1} is at index {2}"), + sizeOfArry, lastName, lastIndex); + + if(names[0] == "James") + { + Console.WriteLine("James is in posistion 0"); + } else if(names[1]) + + { + + } + } + } +} diff --git a/practice3/practice3.csproj b/practice3/practice3.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/practice3/practice3.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + + From acf6e3fe8b22ac5e258431ee09d4ddddf1b69757 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Mon, 15 Oct 2018 20:45:24 -0500 Subject: [PATCH 07/11] initial push --- TicTacToe/TicTacToe.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index a8693842..7bf8f1e8 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -26,7 +26,7 @@ public static void Main() Console.ReadLine(); } - public static int GetInput(int row , int column ) + public static int[1] GetInput() { Console.WriteLine("Player " + playerTurn); Console.WriteLine("Enter Row:"); @@ -39,6 +39,7 @@ public static bool PlaceMark(int row, int column) { // your code goes here //change to bool + } public static bool CheckForWin() From e3ac1f6ebcd6e1bacb1e19be90a61360aa5d7dff Mon Sep 17 00:00:00 2001 From: DeMarco Date: Mon, 22 Oct 2018 18:46:51 -0500 Subject: [PATCH 08/11] initial TTT game --- TicTacToe/TicTacToe.cs | 69 +++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index 7bf8f1e8..ce5e8db3 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -26,29 +26,51 @@ public static void Main() Console.ReadLine(); } - public static int[1] GetInput() + public static void GetInput() { Console.WriteLine("Player " + playerTurn); Console.WriteLine("Enter Row:"); int row = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Column:"); int column = int.Parse(Console.ReadLine()); + + PlaceMark(row, column); + + // playerTurn == "X" ? playerTurn = "O" : playerTurn = "X"; } - public static bool PlaceMark(int row, int column) + public static bool PlaceMark(int row, int column) { - // your code goes here - //change to bool - + if (board[row][column] != "") { + Console.WriteLine ( "The row column is already taken"); + return false; + } + + board [row][column] = playerTurn; + + return true; } - - public static bool CheckForWin() + public static bool CheckForWin() { - // your code goes here + if ( HorizontalWin()) + { + return true; + } + else if ( VerticalWin()) + { + return true; + } + else if (DiagonalWin()) + { + return true; + } - return false; + + return false; + } + public static bool CheckForTie() { // your code goes here @@ -56,25 +78,36 @@ public static bool CheckForTie() return false; } - public static bool HorizontalWin() + public static bool HorizontalWin() { - // your code goes here - - return false; + for (int i = 0; i Date: Mon, 22 Oct 2018 20:16:59 -0500 Subject: [PATCH 09/11] finail TTT --- TextGame/textgame.csproj | 8 ---- TicTacToe/TicTacToe.cs | 99 +++++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 55 deletions(-) delete mode 100644 TextGame/textgame.csproj diff --git a/TextGame/textgame.csproj b/TextGame/textgame.csproj deleted file mode 100644 index 23df6047..00000000 --- a/TextGame/textgame.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - Exe - netcoreapp2.1 - - - diff --git a/TicTacToe/TicTacToe.cs b/TicTacToe/TicTacToe.cs index ce5e8db3..539fca3c 100644 --- a/TicTacToe/TicTacToe.cs +++ b/TicTacToe/TicTacToe.cs @@ -18,7 +18,7 @@ public static void Main() { DrawBoard(); GetInput(); - + } while (!CheckForWin() && !CheckForTie()); @@ -33,41 +33,42 @@ public static void GetInput() int row = int.Parse(Console.ReadLine()); Console.WriteLine("Enter Column:"); int column = int.Parse(Console.ReadLine()); - - PlaceMark(row, column); - - // playerTurn == "X" ? playerTurn = "O" : playerTurn = "X"; + + PlaceMark(row, column); + + // playerTurn == "X" ? playerTurn = "O" : playerTurn = "X"; } - public static bool PlaceMark(int row, int column) + public static bool PlaceMark(int row, int column) { - if (board[row][column] != "") { - Console.WriteLine ( "The row column is already taken"); - return false; - } - - board [row][column] = playerTurn; - - return true; + if (board[row][column] != " ") + { + Console.WriteLine("The row column is already taken"); + return false; + } + + board[row][column] = playerTurn; + + return true; } - public static bool CheckForWin() + public static bool CheckForWin() { - if ( HorizontalWin()) + if (HorizontalWin()) + { + return true; + } + else if (VerticalWin()) { return true; - } - else if ( VerticalWin()) - { - return true; - } - else if (DiagonalWin()) + } + else if (DiagonalWin()) { - return true; - } + return true; + } + + + return false; - - return false; - } @@ -77,35 +78,39 @@ public static bool CheckForTie() return false; } - - public static bool HorizontalWin() + + public static bool HorizontalWin() { - for (int i = 0; i Date: Mon, 22 Oct 2018 22:05:07 -0500 Subject: [PATCH 10/11] final Fizzbuzz --- FizzBuzz/FizzBuzz.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/FizzBuzz/FizzBuzz.cs b/FizzBuzz/FizzBuzz.cs index 9246f703..f3f1cab3 100644 --- a/FizzBuzz/FizzBuzz.cs +++ b/FizzBuzz/FizzBuzz.cs @@ -6,7 +6,26 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + for (int i = 1; i <= 100; i++) + { + if (i % 3 == 0 & i % 5 == 0) + { + Console.WriteLine("FizzBuzz"); + } + else if (i % 5 == 0) + { + Console.WriteLine("Buzz"); + } + else if (i % 3 == 0) + { + Console.WriteLine("Fizz"); + } + else + { + Console.WriteLine(i); + } + } + } } } From bca0698332fd8c755776fb709bc2a6896f0eb384 Mon Sep 17 00:00:00 2001 From: DeMarco Date: Mon, 22 Oct 2018 22:14:42 -0500 Subject: [PATCH 11/11] updated --- FizzBuzz/FizzBuzz.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FizzBuzz/FizzBuzz.cs b/FizzBuzz/FizzBuzz.cs index f3f1cab3..4dcb5f4a 100644 --- a/FizzBuzz/FizzBuzz.cs +++ b/FizzBuzz/FizzBuzz.cs @@ -8,7 +8,7 @@ static void Main(string[] args) { for (int i = 1; i <= 100; i++) { - if (i % 3 == 0 & i % 5 == 0) + if (i % 3 == 0 && i % 5 == 0) { Console.WriteLine("FizzBuzz"); }