4

The Worst Number-Guessing Game Ever

 2 years ago
source link: http://programmingbydoing.com/a/the-worst-number-guessing-game-ever.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
The Worst Number-Guessing Game Ever
  • Author: Graham Mitchell
  • Filename: WorstGuessing.java

The Worst Number-Guessing Game Ever

Write a program that plays an incredibly stupid number-guessing game. The user will get one try to guess the secret number. Tell them if they got it right or wrong, and if they got it wrong, display what the secret number was.

You must store the secret number in a variable, and use that variable throughout. The secret number itself must not appear in the program at all, except in the one line where you store it into a variable.

I know it will be the same number every time the game is played.

TEH WORST NUBMER GESSING GAME EVAR!!!!!!!1!

I"M THKING OF A NBR FROM 1-10.  TRY 2 GESS! 3

W00T!  U SUX0R!!!  I PWN J00!!!  IT WAS 4!
TEH WORST NUBMER GESSING GAME EVAR!!!!!!!1!

I"M THKING OF A NBR FROM 1-10.  TRY 2 GESS! 4

LOL!!! U GOT IT!  I CANT BELEIVE U GESSED IT WAS 4!
TEH WORST NUBMER GESSING GAME EVAR!!!!!!!1!

I"M THKING OF A NBR FROM 1-10.  TRY 2 GESS! 4

LOL!!! U GOT IT!  I CANT BELEIVE U GESSED IT WAS 4!
TEH WORST NUBMER GESSING GAME EVAR!!!!!!!1!

I"M THKING OF A NBR FROM 1-10.  TRY 2 GESS! 4

LOL!!! U GOT IT!  I CANT BELEIVE U GESSED IT WAS 4!

/me walks away shaking his head....

©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK