LectureDeckInClass

LectureDeckInClass - class called Random the purpose of...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Design a deck of cards that will be used for many card games Hearts Spades Poker BlackJack Nouns: Card Number Suit Deck 52 Cards Choosing between: class variable local variable instance variable class variable - all decks would share the same value - NO local variable - created when the method is called and destroy when it leaves, it is NOT stored between calls - NO instance variable - a copy for each deck and stay around between method calls
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: class called Random the purpose of this class is to provide random numbers War Split the deck into two decks Take the top two cards, whichever card is higher, wins If they are the same, take out the top six cards, then play again. The winner collects the cards each time, and the person with the most at the end wins....
View Full Document

Ask a homework question - tutors are online