Created
January 28, 2021 19:17
-
-
Save captain-woof/811d836bb82c61398f9422f86a2447ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| main(){ | |
| unsigned int random; | |
| int answer; | |
| /* CODE TO PRINT BANNER */ | |
| /* Seeding rand() with the current unix time below */ | |
| time_t seed = time(0); | |
| srand(seed); | |
| /* Loop that checks for correctness of user's guesses */ | |
| for(int i=1; i<=30; i++){ | |
| /* CODE TO PRINT PROMPT */ | |
| random = rand() & 15; | |
| /* CODE TO PRINT PROMPT */ | |
| scanf("some prompt here: %d",&answer); | |
| if(answer == random){ | |
| continue; | |
| }else{ | |
| /* CODE TO PRINT EXIT MSG */ | |
| exit(); | |
| } | |
| } | |
| /* CODE FOR SUCCESS MESSAGE TO BE PRINTED */ | |
| get_flag(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment