EECS 12 Summer 2006 Homework 7

General Instructions

Please place your programs in seperate files named as described in the problem. Improperly named programs will not count. Turn in your files by placing them in the dropbox. Please be mindful of the late policy.

Grading

Correct80%
Commented10%
Attempted10%

Problems

Problem 0: 100 points

Make a bomb squad simulation program called bomb.py

Below are two example runs of the program.


Pick a wire to cut:
1) red
2) green
3) blue
4) yellow
5) brown
6) pink
? 1
Cut the red wire. Nothing happened.
Pick a wire to cut:
1) green
2) blue
3) yellow
4) brown
5) pink
? 6
Not a valid choice!
Pick a wire to cut:
1) green
2) blue
3) yellow
4) brown
5) pink
? 5
Cut the pink wire. Nothing happened.
Pick a wire to cut:
1) green
2) blue
3) yellow
4) brown
? 3
Cut the yellow wire... BOOOOOOOOOOOOOOOOM!

Pick a wire to cut: 1) red 2) green 3) blue 4) yellow 5) brown 6) pink ? 3 Cut the blue wire. Nothing happened. Pick a wire to cut: 1) red 2) green 3) yellow 4) brown 5) pink ? 4 Cut the brown wire. Nothing happened. Pick a wire to cut: 1) red 2) green 3) yellow 4) pink ? 3 Cut the yellow wire. Nothing happened. Pick a wire to cut: 1) red 2) green 3) pink ? 1 Cut the red wire. Nothing happened. Pick a wire to cut: 1) green 2) pink ? 1 Cut the green wire... You saved the day!