Building Memory… Day 5 – April 13, 2007

advertisement
Building Memory…
Day 5 – April 13, 2007
Cards on Screen
• How can we arrange cards in a
row/column manner?
• Use the Position class to help us
translate row/column coordinates
into java.awt.Points
• Use of interface for constants
Constants Interface
• Only has values in it, no methods
necessarily
• To create a constant in the interface, it is
declared to be:
– public (We’ve seen this before)
– static (If something is static, you do not need
to create an instance of the class it is in to
access it)
– final (Means it can not change)
Cards on Screen
• We showed the faces on the screen
to check to make sure we have 20
different cards (10 pairs of 2) and
that they seemed to be reasonably
randomized on the screen.
Problem!
• Only 10 pictures show up, but it
seems like we have a place for 20
cards…
A note about references
Download