Intro to
(with Python)

Fall 2018

Tue Nov 13

Discuss the homework and look at Jim's card game classes as examples.

What are you thinking of for a final project?

Please read chapter 12, "object oriented design" ... that's the topic for this week. It's essentially just more practice with using objects.

Between now and the end of the term the coding assignments will be short, in order to leave you time to work on your projects ... so do that, eh?

Consensus was that it was best to walk through a black jack object program slowly, so I wrote one during class and explained it.

It's attached. This one is simpler than my examples linked above.

$ python 
New deck: <Deck of 52 cards>
Pulled top card. It is king of spades.
The deck is now : <Deck of 51 cards>
-- adding cards to a hand --
value=0 <Hand of 0 cards: >
value=3 <Hand of 1 cards: three of spades, >
value=5 <Hand of 2 cards: three of spades, two of clubs, >
value=13 <Hand of 3 cards: three of spades, two of clubs, eight of diamonds, > /cours /fall2018 /python /notes /cards
last modified Tue December 5 2023 9:00 am

attachments [paper clip]

  last modified size
TXT Tue Dec 05 2023 09:00 am 2.7K