Monday, 10 November 2014

Rock, Paper, Scissors Game in JAVA.

The most loved and played game among the children's is here with JAVA. As the game is simple so is the code. It is based on simple switch...case...default. structure. It is programmed by me within 15 mins as the idea came to my mind

Game Play Instructions :
It is simple. Just enter "rock" or "paper" or "scissor" and the program calls the random functions which in turn uses the computers internal clock to get a random value. As we know that the random function in java returns a value greater than 0.00 and less than 1.00 I have multiped the value to get an integer between 1-3 which i used in the switch...case...default.

Snapshot: 

Source Code:

0 comments :

Post a Comment