Olympic Game Example Runs
A losing game
This is an example run when the player loses the game:
$ python olympics.py
Welcome! I will select a set of winter olympic sports for you to watch
over the next 4 days, chosing a different one for each day from the set:
A: Alpine sking
C: Curling
H: Hockey
L: Luge
N: Nordic sking
S: Speed skating
To make this fun, you have to guess what I picked. Each round you will enter
your guess for the sport on each day, and we will give you the following
information about your guess to help with subsequent guesses:
1. the number of sports you guessed correctly
2. the number sports you guessed correctly on their correct day
You have 10 chances to guess correctly.
Good luck!
--------------------------------------------------
Round 1 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: A
enter sport for day 2: A
enter sport for day 3: C
enter sport for day 4: C
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 2
Number of correct sports on the correct day: 1
Try again...
Round 2 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: L
enter sport for day 2: N
enter sport for day 3: A
enter sport for day 4: A
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 2
Number of correct sports on the correct day: 1
Try again...
Round 3 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: A
enter sport for day 2: C
enter sport for day 3: H
enter sport for day 4: L
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 3
Number of correct sports on the correct day: 0
Try again...
Round 4 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: A
enter sport for day 2: C
enter sport for day 3: H
enter sport for day 4: N
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 0
Try again...
Round 5 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: C
enter sport for day 2: A
enter sport for day 3: H
enter sport for day 4: N
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 0
Try again...
Round 6 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: H
enter sport for day 2: C
enter sport for day 3: A
enter sport for day 4: N
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 0
Try again...
Round 7 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: A
enter sport for day 2: N
enter sport for day 3: H
enter sport for day 4: C
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 0
Try again...
Round 8 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: N
enter sport for day 2: A
enter sport for day 3: H
enter sport for day 4: C
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 1
Try again...
Round 9 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: N
enter sport for day 2: H
enter sport for day 3: A
enter sport for day 4: C
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 2
Try again...
Round 10 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: H
enter sport for day 2: N
enter sport for day 3: N
enter sport for day 4: N
Sorry, that isn't correct.
That isn't correct & you are out of tries...you lose.
The answer was:
( N, H, C, A )
A winning game
This is an example run when the player wins the game:
$ python olympics.py
Welcome! I will select a set of winter olympic sports for you to watch
over the next 4 days, chosing a different one for each day from the set:
A: Alpine sking
C: Curling
H: Hockey
L: Luge
N: Nordic sking
S: Speed skating
To make this fun, you have to guess what I picked. Each round you will enter
your guess for the sport on each day, and we will give you the following
information about your guess to help with subsequent guesses:
1. the number of sports you guessed correctly
2. the number sports you guessed correctly on their correct day
You have 10 chances to guess correctly.
Good luck!
--------------------------------------------------
Round 1 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: A
enter sport for day 2: A
enter sport for day 3: A
enter sport for day 4: A
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 0
Number of correct sports on the correct day: 0
Try again...
Round 2 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: C
enter sport for day 2: C
enter sport for day 3: H
enter sport for day 4: H
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 2
Number of correct sports on the correct day: 1
Try again...
Round 3 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: H
enter sport for day 2: C
enter sport for day 3: L
enter sport for day 4: N
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 4
Number of correct sports on the correct day: 2
Try again...
Round 4 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: H
enter sport for day 2: C
enter sport for day 3: C
enter sport for day 4: H
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 2
Number of correct sports on the correct day: 2
Try again...
Round 5 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: H
enter sport for day 2: C
enter sport for day 3: N
enter sport for day 4: L
Congratulations! you won in 5 tries!
The answer was:
( H, C, N, L )
Error handling
This is output from just part of a run, showing examples of error handling when the user enters an invalid guess option.
$ python olympics.py
...
Round 1 pick sports from:
( A, C, H, L, N, S )
enter sport for day 1: hello
hello is not a valid sport, try again from this set:
( A, C, H, L, N, S )
enter sport for day 1: blah
blah is not a valid sport, try again from this set:
( A, C, H, L, N, S )
enter sport for day 1: a
a is not a valid sport, try again from this set:
( A, C, H, L, N, S )
enter sport for day 1: A
enter sport for day 2: C
enter sport for day 3: grr
grr is not a valid sport, try again from this set:
( A, C, H, L, N, S )
enter sport for day 3: s
s is not a valid sport, try again from this set:
( A, C, H, L, N, S )
enter sport for day 3: S
enter sport for day 4: N
Sorry, that isn't correct.
Here is some information to help you with your next try:
Number of correct sports: 2
Number of correct sports on the correct day: 1
Try again...
...