[Tutor] Show commands
Adam Vardy
Adam Vardy <anvardy@roadrunner.nf.net>
Sat Dec 28 20:30:02 2002
Saturday, December 28, 2002, 7:43:30 PM, you wrote:
>> On Fri, 27 Dec 2002, Adam Vardy wrote:
>> Although shuffle() itself is doing a bunch of stuff, the author decided
>> that the actions, taken as a whole, was "shuffling" the list of cards.
I think I'm Ok with shuffling.
>> A lot of programs work in this way, bundling up a bunch of compound
>> actions as a single name. When we say deck.deal(), we're actually doing
>> quite a few things:
>> ###
>> ### See Section 16.3 of thinkCSpy
>> ###
>> def deal(self, hands, nCards=999):
>> nHands = len(hands)
>> for i in range(nCards):
>> if self.isEmpty(): break # break if out of cards
>> card = self.popCard() # take the top card
>> hand = hands[i % nHands] # whose turn is next?
This line I'm not sure about.
I am not sure what is [hand] or what is happening to it.
And there are some lines output, some indented, some are not. I don't
know where these lines come from.
Hand frank contains 2 of spades...
>> Does this make sense at the moment? What parts seem strange or uncertain?
Those are the main things.
--
Adam Vardy