using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp2 { class Program { static void Main(string[] args) { int Keuze = 0; string KeuzeString = ""; string CPUKeuzeString = ""; int Win = 0; int Gelijk = 0; int Verloren = 0; goto Menu; Menu: Keuze = 0; Console.Clear(); Console.WriteLine("Hello, what do you wish to do?"); Console.WriteLine("1 = Play, 2 = Scores, 3 = Exit"); string EersteInput = Console.ReadLine(); if (EersteInput == "1") { goto StartSpel; } else if (EersteInput == "2") { goto Scores; } else if (EersteInput == "3") { goto SluitApp; } else { goto Menu; } StartSpel: Console.Clear(); Random RandomNum = new Random(); int CPUKeuze = RandomNum.Next(1, 4); if (CPUKeuze == 1) { CPUKeuzeString = "Scissors"; } else if (CPUKeuze == 2) { CPUKeuzeString = "Stone"; } else if (CPUKeuze == 3) { CPUKeuzeString = "Paper"; } //1 == schaar, 2 == steen, 3 == papier //1 ^ 3, 2 ^ 1, 3 ^ 2, 1 == 1, 2 == 2, 3 = 3 Console.WriteLine("Choose: 1 = Scissors, 2 = Rock, 3 = Paper"); string DerdeKeuze = Console.ReadLine(); Console.WriteLine(""); if (DerdeKeuze == "1") { Keuze = 1; KeuzeString = "Scissors"; goto TweedeFase; } else if (DerdeKeuze == "2") { Keuze = 2; KeuzeString = "Stone"; goto TweedeFase; } else if (DerdeKeuze == "3") { Keuze = 3; KeuzeString = "Paper"; goto TweedeFase; } else { goto StartSpel; } TweedeFase: Console.Clear(); Console.WriteLine("You chose: {0}, the CPU chose: {1}",KeuzeString, CPUKeuzeString); if (Keuze == CPUKeuze) { Console.WriteLine("It's a tie."); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Gelijk += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } if (CPUKeuze == 1) { if (Keuze == 3) { Console.WriteLine("CPU wins. (CPU: {0}, P1: {1})", CPUKeuzeString, CPUKeuzeString); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Verloren += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } else { Console.WriteLine("Player wins. (P1: {0}, CPU: {1})", KeuzeString, CPUKeuzeString); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Win += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } } if (CPUKeuze == 2) { if (Keuze == 1) { Console.WriteLine("CPU wins. (CPU: {0}, P1: {1})", CPUKeuzeString, CPUKeuzeString); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Verloren += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } else { Console.WriteLine("Player wins. (P1: {0}, CPU: {1})", KeuzeString, CPUKeuzeString); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Win += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } } if (CPUKeuze == 3) { if (Keuze == 2) { Console.WriteLine("CPU wins. (CPU: {0}, P1: {1})", CPUKeuzeString, CPUKeuzeString); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Verloren += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } else { Console.WriteLine("Player wins. (P1: {0}, CPU: {1})", KeuzeString, CPUKeuzeString); Console.WriteLine("Do you wish to play again? 1 = Menu, 2 = Exit"); string VierdeKeuze = Console.ReadLine(); Win += 1; if (VierdeKeuze == "1") { goto Menu; } else if (VierdeKeuze == "2") { goto SluitApp; } } } Scores: Console.Clear(); Console.WriteLine("Wins: {0}, Losses: {1}, Draws: {2}", Win, Verloren, Gelijk); Console.WriteLine("What do you want to do? 1 = Main Menu, 2 = Exit"); string KeuzeTwee = Console.ReadLine(); if (KeuzeTwee == "1") { goto Menu; } else if (KeuzeTwee == "2") { goto SluitApp; } else { goto Scores; } SluitApp: System.Environment.Exit(1); } } }