Difference between revisions of "CSC111 Homework 3 2014"
(Created page with "--~~~~ ---- <bluebox> This assignment asks you to add new levels of testing with if-statements in the Rock-Paper-Scissors game. </bluebox> <br /> <br /> __TOC__ <br /> <br /> ...") |
(→Problem #1: Test for invalid inputs) |
||
Line 15: | Line 15: | ||
Your assignment is to take the Rock-Paper-Scissors game from [[CSC111 Lab 3 2014| Lab 3]] and to make sure it implements the following features (some part of Lab 3's program, some new): | Your assignment is to take the Rock-Paper-Scissors game from [[CSC111 Lab 3 2014| Lab 3]] and to make sure it implements the following features (some part of Lab 3's program, some new): | ||
− | # Your program should let the user play 3 rounds with the computer. | + | # Your program should let the user play 3 rounds with the computer.<br /> |
− | # Your program should keep track of whose is winning and print the winner of the 3 rounds at the end. | + | # Your program should keep track of whose is winning and print the winner of the 3 rounds at the end.<br /> |
− | # Your program should accept upper or lower case inputs from the user. So '''r''' and '''R''' should be recognized as meaning '''Rock'''. | + | # Your program should accept upper or lower case inputs from the user. So '''r''' and '''R''' should be recognized as meaning '''Rock'''. Similarly for the other letters.<br /> |
− | # If the user does not enter one of the valid inputs ('R', 'S', or 'P') the program will ask the user to reenter the character. But only once. If the character entered by the user a second is not one of 'R', 'S', or 'P', the computer will automatically win that round. | + | # If the user does not enter one of the valid inputs ('R', 'S', or 'P') the program will ask the user to reenter the character. But only once. If the character entered by the user a second is not one of 'R', 'S', or 'P', the computer will automatically win that round. <br /> |
<br /> | <br /> |
Revision as of 21:24, 12 February 2014
--D. Thiebaut (talk) 21:23, 12 February 2014 (EST)
This assignment asks you to add new levels of testing with if-statements in the Rock-Paper-Scissors game.
Problem #1: Test for invalid inputs
Your program will be called hw3a.py.
Your assignment is to take the Rock-Paper-Scissors game from Lab 3 and to make sure it implements the following features (some part of Lab 3's program, some new):
- Your program should let the user play 3 rounds with the computer.
- Your program should keep track of whose is winning and print the winner of the 3 rounds at the end.
- Your program should accept upper or lower case inputs from the user. So r and R should be recognized as meaning Rock. Similarly for the other letters.
- If the user does not enter one of the valid inputs ('R', 'S', or 'P') the program will ask the user to reenter the character. But only once. If the character entered by the user a second is not one of 'R', 'S', or 'P', the computer will automatically win that round.