• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pick Up Sticks Game Help  RSS feed

 
Jack Messenger
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi have made the game Pick up sticks and it works ok except for one part. I want the program to display a message for an invalid input such as" can only enter numbers 1 or 2". Can someone help me with that part of code?
The game rules are whoever gets to the last stick looses.

   
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want the program to display a message for an invalid input such as" can only enter numbers 1 or 2".

You mean like using an if statement to detect the invalid input and then call println to show a message?

Then what?  How would those statements fit with the rest of the code?
 
Campbell Ritchie
Marshal
Posts: 56576
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and welcome to the Ranch
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!