• Post Reply Bookmark Topic Watch Topic
  • New Topic

Play again help  RSS feed

 
Michael rust
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i implement my boolean playAgain code to make it restart the game loop? Because now when i answer YES or NO nothing happens, I want it to restart the game and change round to round 2

 
Les Morgan
Rancher
Posts: 779
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael,

You need to implement your game as a method or launched in a method:

boolean bLoop=true;
int iLoop =1;
while(bLoop){
//game call goes here--use iLoop as a parameter for the game number
//looping condition goes here, change bLoop to false to exit, increment iLoop here to got to next game number
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!