Building Memory… Day 4 – April 11, 2007

advertisement
Building Memory…
Day 4 – April 11, 2007
We can put cards on the
screen!
• BUT
• We need to put pairs of cards on the
screen in a “random” way
• Creation of the Dealer class
Dealer Class
• Creates pairs of cards
• Shuffles cards
• Accessor to return deck
Changes to Game
• Asks the Dealer to create the cards
and shuffle them
• Gets the deck from the dealer
• NOW – we have to position them on
the screen
Where should cards
appear?
• A grid of rows and columns seems to
make the most sense.
• How do we position the cards
appropriately in the rows and
columns? (Think about this for next
class)
Download