hello im stuck trying to use a bool to rerun the program im not sure how to prompt a user to input a char ...if some one could help me out here pretty soon that would be great...ill be up all night =)
note: this program Im finished Im stuck on this part ...im just not sure how to do this using DarkGDK thanks again
#include "DarkGDK.h"
void numberGuessingGame();
void DarkGDK ()
{
dbPrint(" ############################################################################");
dbPrint(" # LAME GAME! #");
dbPrint(" # #");
dbPrint(" # PLEASE CHOOSE FROM ONE OF THE FOLLOWING OPTIONS BELOW #");
dbPrint(" # BY CHOOSING THE NUMBER THEN PRESS ENTER: #");
dbPrint(" # #");
dbPrint(" # 1.NUMBER GUESSING GAME #");
dbPrint(" # 2.DART GAME #");
dbPrint(" # 3.PICTURE PLAY #");
dbPrint(" # 4.EXIT #");
dbPrint(" # #");
dbPrint(" # #");
dbPrint(" # #");
dbPrint(" ############################################################################");
dbPrint(" ");
dbPrint(" ");
dbPrint(" ");
dbPrint(" ");
dbPrint(" ");
dbPrint(" ");
dbPrint(" BY JED ");
dbPrint(" PLEASE DONATE =) ");
dbWaitKey();
int option;
option=atoi(dbInput());
if (option<2)
{ dbCLS( );
dbPrint("you have selected option 1");
numberGuessingGame();
dbWaitKey();}
}
void numberGuessingGame()
{ bool REPEAT=1;
while(REPEAT==1){
dbLoadImage("grats.jpg",1);
dbLoadImage("ok.jpg",2);
dbLoadImage("yousuck.jpg",3);
int guess,num,c=0;
const int maxnum=1000;
dbRandomize(dbTimer());
num=dbRND(maxnum);
dbPrint("guess the random number im thinking of!");
guess=atoi(dbInput());
while(guess!=num){c++;
if(guess<num){
dbPrint("sorry to low...keep going");}
else{
dbPrint("thats to high...try again");}
guess=atoi(dbInput());
}
if(c==1){
dbPrint("congrats...YOU GUESSED IT on the first try! your amazing!");
dbPasteImage(1,0,0,0);}
if(c>1&&c<=10)
{dbPrint("at least your not a total loser");
dbPasteImage(2,0,0,0);
}
else{
dbPrint("wow..no offence,but this just is not your game");
dbPasteImage(3,0,50,0);
dbPrint("it took you");
dbPrint( dbStr(c));
dbPrint("tries");}
}
dbPrint("would you like to play again?");
// right here i do not know how to use dbInput()
// to input chars
if (rep=='n'||rep=='N'){
REPEAT=0;}
}