Skip to content

Instantly share code, notes, and snippets.

@TheEpicFace007
Last active August 10, 2020 02:56
Show Gist options
  • Save TheEpicFace007/60c31fcbee4be94b0299dcb26929d1bd to your computer and use it in GitHub Desktop.
Save TheEpicFace007/60c31fcbee4be94b0299dcb26929d1bd to your computer and use it in GitHub Desktop.
cursed_guess_the_number_game
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