ONLINE COMPILERS
LIBRARY
MANUAL PAGES & DOCS
CONTACT
Latest Users' Questions
User Submitted Source Code!
Description:
Tribute to Abeiku
Language: C/C++
Code:
Tribute to Abeiku
Language: C/C++
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("color 1e");
printf("Game by Charles Owiredu-Gyening. \n");
printf("Hope you Enjoy it!, Or not : ) \n");
printf("On the scale of 1-10, how foolish is Jacob? \n");
int secretNumber = 10;
int guess;
int guessCount = 0;
int guessLimit = 10;
int outofGuesses = 0;
/* This line is a loop statement and it lets C check the co-relation between the guess and the secret number */
while(guess != secretNumber && outofGuesses == 0){
if(guessCount < guessLimit){
printf("Enter Level of Stupidity: n");
scanf("%d", &guess);
guessCount++;
if(guess < secretNumber){
printf("Go Higher \n");
} if(guess > secretNumber){
printf("Go Lower n");
}
} else {
outofGuesses = 1;
}
}
if (outofGuesses == 1) {
printf("Your head die too much\n");
} else {
printf("You Won. Go chill plus your paddies ");
}
return 0;
}
#include <stdlib.h>
int main()
{
system("color 1e");
printf("Game by Charles Owiredu-Gyening. \n");
printf("Hope you Enjoy it!, Or not : ) \n");
printf("On the scale of 1-10, how foolish is Jacob? \n");
int secretNumber = 10;
int guess;
int guessCount = 0;
int guessLimit = 10;
int outofGuesses = 0;
/* This line is a loop statement and it lets C check the co-relation between the guess and the secret number */
while(guess != secretNumber && outofGuesses == 0){
if(guessCount < guessLimit){
printf("Enter Level of Stupidity: n");
scanf("%d", &guess);
guessCount++;
if(guess < secretNumber){
printf("Go Higher \n");
} if(guess > secretNumber){
printf("Go Lower n");
}
} else {
outofGuesses = 1;
}
}
if (outofGuesses == 1) {
printf("Your head die too much\n");
} else {
printf("You Won. Go chill plus your paddies ");
}
return 0;
}
Comments: