If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

RSP game...application

I am having trouble writing this application of Paper, Rocks and scissors.
If you can help me i sure would appreciate it.

The first portion is what
the application is suppose to do, and the second part is the code that
I
have already written.

This application is suposse to stimulate the user against teh computer.
It must maintain the overall score and report it at the end. It must
use
three methods other than main, handle mutiple roudns, and include error
trapping,
and count the rounds down. It must randomly generate the computers
generation
of rock, paper and scissors.
A rock can break the scissors
the scissors can cut the paper
the paper can cover the rock.
0 = rock
1 = scissors
2 = paper

This is a sample of whta the application should look like:

Welcome to eh Rock, Paper, Scissors game.
How many rounds do you want to play? 2
This is roudns 2
Enter a number from 0 to 2, where 0 is for rock, 1 is for scissors,
and 2
is for paper.
I will show you min when you press enter.
0. I WIN. Paper gets teh rock

This is round 1
Enter a number from 0 to 2, where 0 is for rock, 1 is for scissors,
and 2
is for paper.
I will show you mine when you press enter.
4. Out of range. The number should be between 0 and 2.
2. A tie.
WE both show paper.
I have a score of 1 bu you have a score of 0.

mport Keyboard.*;

class RockScissorPaper {
// This program simulates the game of Rock Scissors Paper

public static int readNumber (int value) {
// returns a number between low and high, inclusive, provided
by
// the user
// it provides an error message and asks for the number again
each
//time a number out of range is provided
value =Keyboard.readInt();
do
System.out.println ("ERROR");
while (value > 2 && value < 0);
return (value);