Last active
August 10, 2020 02:56
-
-
Save TheEpicFace007/60c31fcbee4be94b0299dcb26929d1bd to your computer and use it in GitHub Desktop.
cursed_guess_the_number_game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace cursed_csharp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
{}{}{}{}{}{}{}{}Console.Title = "Guess the number vee 1 - cursed_csharp"; | |
{}{}{}{}{}{}{}{}Console.WriteLine("Welcome to the game of guessing the number of one to one hundread!"); | |
{}{}{}{}{}{}{}{}Random rnd = new Random(); | |
{}{}{}{}{}{}{}{}string NumberToGuess = rnd.Next(1, 100).ToString(); | |
{}{}{}{}{}{}{}{}Console.WriteLine("Give me a number that is between 1 and hundread."); | |
{}{}{}{}{}{}{}{}string ans = ""; | |
{}{}{}{}{}{}{}{}while (ans.ToString() != NumberToGuess.ToString()) | |
{ | |
{}{}{}{}{}{}{}{}{}{}{}{}Console.WriteLine("Give me a number that is between 1 and hundread."); | |
{}{}{}{}{}{}{}{}{}{}{}{}ans = Console.ReadLine(); | |
{}{}{}{}{}{}{}{}{}{}{}{}Console.WriteLine($"The number is not correct. Try again. IsSmallerThanNbToGuess? {int.Parse(ans) < int.Parse(NumberToGuess)}"); | |
{}{}{}{}{}{}{}{}} | |
{}{}{}{}{}{}{}{}Console.WriteLine("Congrat you have beaten the game."); | |
{}{}{}{}{}{}{}{}Console.ReadKey(); | |
{}{}{}{}} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment