Skip to content

Conversation

@d3marco
Copy link
Owner

@d3marco d3marco commented Oct 29, 2018

No description provided.

{
Console.Write("Enter a number: or ok to exit : ");
String input = Console.ReadLine();
if (input == "ok" || input.ToLower() == "ok") break;
Copy link

@yousifS yousifS Oct 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

braces after for the if condition blocks is a good habit to get used to.

if (input == "ok" || input.ToLower() == "ok") {
    break;
} 
if (string.IsNullOrWhiteSpace(input)) {
    continue;
}

{
Console.WriteLine("Pick a random number between 1-10");
int number = int.Parse(Console.ReadLine());
Random rnd = new Random();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The computer picks a random number for each of my guesses. instead of giving me 4 chances to guess the computer's number.

break;

} else {
Console.WriteLine("You Lost");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it would give me 4 chances before telling me I lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants