Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,39 @@
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSLog(@"I'm thinking of a number between 1 - 10. Can you guess what it is?\n");
int rndNumber = arc4random_uniform(10) + 1;
// Debug (Show rndNumber in console)
//NSLog(@"Random number is %i", rndNumber);
int userInput;
do {
NSLog(@"Input the number below\n");
scanf("%i", &userInput);
if (userInput > 10) {
NSLog(@"Please enter a number less than 10\n");
}
if (userInput > 10 || userInput != rndNumber) {
NSLog(@"Your guess %i is incorrect, please try again", userInput);
} else {
NSLog(@"Your guess %i is correct!", userInput);
}
} while (userInput > 10 || userInput != rndNumber);
}
return 0;
}