6) 601 - Rock, Paper, Scissors (v3)
Problem type
Problem type
What do you know?
nouns
knouns
choices
1) rock
2) paper
3) scissors
game results
win
lose
draw
rules
rock beats scissors
scissors beats paper
paper beats rock
unknouns
Input:
user's choice
Process:
computer's choice
game result
Output:
computer's choice
game result
Use case(s)
Primary
1) Welcome ...
1) Display title of program
2) Display instructions
2) Input: choice from the user/player
1) Prompt user for input
2) "Read" user/player input
3) Process: the input
1) Computer generates its choice
2) Indentify winner
4) Output results
1) Display computer's choice
2) Display win, lose or draw
5) THE END ...
making change
with menu
What don't you know?
randomize computer choice
Subtopic
What assumptions are you making?
Solution criteria
Console-based
program
write functions
display help if user doesn't
know how to play RPS
user will indicate:
Play a single game
Play best of
Display help
Exit
if/else if/else, switch or
while (looping) logic only
computer will generate a
random number 0, 1, or 2/
ROCK, PAPER or SCISSORS
use constants for choices and outcomes
validate user selection
using a function
internally, both the computer choice and
user choice will use the same data type
Root cause analysis
Impact analysis
Person
Impact
Six serving men
Analogies
What is it like?
Be the problem
Insight