From f8db17c8fbbf15cabd60d32d7ed0991ee052289e Mon Sep 17 00:00:00 2001 From: berryman Date: Wed, 12 Dec 2012 23:50:34 -0500 Subject: [PATCH] example code extended --- cah.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cah.py b/cah.py index 7e5097d..bcf7dd8 100644 --- a/cah.py +++ b/cah.py @@ -135,12 +135,18 @@ class PlayerHand(object): if __name__=="__main__": game = Game(['Bear','Swim', 'Jazz']) print "\nGame started with the following players: %s \n" % game.players.keys() - game.next_round() + round = game.next_round() print "The first question is: %s \n" % game.question.text - print "Bear's hand:" - game.players['Bear'].showHand() - print "\nJazz's hand" - game.players['Jazz'].showHand() - print "\nSwim's hand" + + print "Swim's hand the easy way:" game.players['Swim'].showHand() + print "\nJazz's hand in a weird way" + round['hands']['Jazz'].showHand() + + print "\nBear's hand the hard way:" + for index, card in enumerate(round['hands']['Bear'].card_list): + print '%s: %s' % (index + 1, card.text) + + +