Hi! im compleetly new at coding and started to watch barnacules codegasm series and one of the episodes is about making a simple magic8ball game, i took this idea and made it a little bit different, but now i need tome help
Here is my cocde atm (I know there is probably way better ways to write this :cheerful and yes it is a drinking game :victorious:
so my question is, if you didnt already notice it, How do i get the program to print out "That's Right.." if the guessed number is the same as the random number?
Here is my cocde atm (I know there is probably way better ways to write this :cheerful and yes it is a drinking game :victorious:
// startingColor ConsoleColor OldColor = Console.ForegroundColor; // tells the user to pick a number GuessRight(); while(true) { //tells the user to "Pick a number" Console.ForegroundColor = ConsoleColor.White; Console.Write("Guess the number!! "); String Question = Console.ReadLine(); Random RandomObj = new Random(); Console.WriteLine("{0}", RandomObj.Next(10) + 1); if (RandomObj == Question) { //How do i get the program to print out "That's Right.." //if the guessed number is the same as the random number? :) my guess was^^ x) Console.WriteLine("That's Right, You Dont Have To Drink"); } } Console.ForegroundColor = OldColor; Console.ReadKey(); } static void GuessRight() { Console.ForegroundColor = ConsoleColor.DarkMagenta; Console.Write(".:Gissa"); Console.ForegroundColor = ConsoleColor.Green; Console.Write(" R?tt"); Console.ForegroundColor = ConsoleColor.Red; Console.Write(" Nummer:."); Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine(" V?lj ett nummer mellan 1-10, gissar du fel m?ste du dricka!");
so my question is, if you didnt already notice it, How do i get the program to print out "That's Right.." if the guessed number is the same as the random number?