| .
|
Random game examples
Write four programs that use random values
----------------------------------------
Lab #19.1: Magic Answer-Machine
----------------------------------------
Write the program specified in the slides
to magically answer any burning question
the user of your program might have.
----------------------------------------
Lab #19.2: Pick a card, any card
----------------------------------------
Write the program specified in the slides
to pick a random card out of a deck of cards
and report how close a guess is to the
random card.
----------------------------------------
Lab #19.3: Roll the dice
----------------------------------------
Write the program specified in the slides
to roll two dice, report the values, and
report if they would have won or lost on
the first roll of a game of craps.
----------------------------------------
Lab #19.4: QuikPick
----------------------------------------
Write the program specified in the slides
to make a random QuikPick for your friends
who play the lottery.
Advanced students can write an extra part of
the program to detect if any of the six numbers
you randomly picked were picked twice, or more!
|