-
Notifications
You must be signed in to change notification settings - Fork 0
Checkpoint1 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Checkpoint1 #6
Conversation
| { | ||
| Console.Write("Enter a number: or ok to exit : "); | ||
| String input = Console.ReadLine(); | ||
| if (input == "ok" || input.ToLower() == "ok") break; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
No description provided.