Solving RPS
RPS involves a lot of
issues, so the best way to solve it is to break it up and work on the
pieces one at a time. Here is one way to go about it...
1. Write a program that reads in a user's choice, picks the
computer's choice, then prints them out.
- Represent choices with integer
- Have a method to get a user choice
- Have a method to get the computer's choice
- Have a method to print out choices
- JAVA CODE
2. Write a program that plays a single game.
- Extend the previous code to compare the two choices
- Write a method to determine the winner
- Use a return of +1 for a win, 0 for a tie, -1 for a loss
- JAVA CODE
on to next stage...