In Class: Week 11
Create a week11 subdirectory in your cs21/class directory:
% cd
% cd cs21/class
% pwd
/home/your_user_name/cs21/class
% mkdir week11
Then, from within your week11 subdirectory copy over some python files
from my public directory:
% cd week11
% pwd
/home/your_user_name/cs21/class/week11
% cp ~newhall/public/cs21/week11/* .
% ls
card.py deck.py digitalclock.py
We are going to do some of the following together:
- open up card.py and add a blackJackValue method function that
returns the Black Jack value of the card. Here are the Black Jack
values we are using:
- cards with rank 2-10 have a black jack value equal to their rank
- King, Queen, and Jack have a black jack value of 10
- Ace has a black jack value of 1
- open up deck.py and complete the constructor that creates a
deck of cards as a list of 52 Card objects of appropriate rank and
suit
- open up deck.py and complete the methods dealOneCard and cardsLeft and
test them.
- implement a regular function, playBlackJack, that plays one game
of black jack against the computer using a shuffled Deck.
- implement the rest of the classes in the digitalclock.py file to
create a digital clock that will be drawn to the graphics window.
It will look something like this when the time is 12:59:13: