Re: [Tutor] Blackjack Betting

2011-07-03 Thread Alan Gauld
"David Merrick" wrote class BJ_Player(BJ_Hand): """ A Blackjack Player. """ def betting(stash): You forgot self so stash will take on the value of the instance. try: if stash > 0: wager = int(input("\nHow much do you want to wager?: "))

Re: [Tutor] Blackjack Betting

2011-07-02 Thread Marc Tompkins
On Sat, Jul 2, 2011 at 4:47 PM, David Merrick wrote: > Each player needs to be able to bet > Traceback (most recent call last): > File "I:/Python/Python Source Code/chapter09/blackjackBetting.py", line > 204, in > main() > File "I:/Python/Python Source Code/chapter09/blackjackBetting.py

[Tutor] Blackjack Betting

2011-07-02 Thread David Merrick
Each player needs to be able to bet # Blackjack # From 1 to 7 players compete against a dealer import cards, games class BJ_Card(cards.Card): """ A Blackjack Card. """ ACE_VALUE = 1 @property def value(self): if self.is_face_up: v = BJ_Card.RANKS.index(self.r

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
Also I must be doing something wrong if I have to enter a "bet = Bet()" into each function where it is used. I tried putting Bet into the other classes' arguments but it did not have any effect. Emile van Sebille wrote: > > On 7/1/2011 12:51 AM Andre Engels said... > >> In this case, the error

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
I was able to get the program started without errors now. What is left now is to: Having the stash change after winning and losing. No matter what, the value in stash stays the same. The conditional statement I made which prevents players with no money from playing is dependent on this. After e

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Emile van Sebille
On 7/1/2011 12:51 AM Andre Engels said... In this case, the error message says: NameError: global name 'bet' is not defined Note use of the term global? That means, at some time at the program, it is told to do something with 'bet', but there is no variable bet. And when does that happen?

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Andre Engels
On Fri, Jul 1, 2011 at 9:29 AM, Vincent Balmori wrote: > > Here is the other one that occurs when I lose > > Traceback (most recent call last): > File > > "/Users/vincentbalmori/Desktop/Python/py3e_source/chapter09/blackjackbetting.py", > line 240, in >main() > File > > "/Users/vincentbalmo

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
stash -= betting.wager? I bet if you > ran lint/pylint on this module it would have told you the error without > even having to run it. > > > Ramit > > > Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology > 712 Main Street | Houston, TX 77002 > wor

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
; ran lint/pylint on this module it would have told you the error without > even having to run it. > > > Ramit > > > Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology > 712 Main Street | Houston, TX 77002 > work phone: 713 - 216 - 5423 > > >

Re: [Tutor] Blackjack Betting

2011-06-30 Thread Prasad, Ramit
sad=jpmchase@python.org [mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of Vincent Balmori Sent: Thursday, June 30, 2011 1:49 PM To: tutor@python.org Subject: [Tutor] Blackjack Betting I have been working on another challenge that involves improving the Blackjack program so

[Tutor] Blackjack Betting

2011-06-30 Thread Vincent Balmori
I have been working on another challenge that involves improving the Blackjack program so the players can wager an amount. If a player loses they will be removed from the game. I keep getting the error: “NameError: global name 'bet' is not defined.” I know I came across this error before in a pre