Re: Python: Code is ignoring the if and else

2013-08-03 Thread kevin4fong
On Friday, August 2, 2013 10:04:56 PM UTC-7, Terry Reedy wrote: > On 8/2/2013 10:24 PM, kevin4f...@gmail.com wrote: > > > > Looking at this again, I believe you actually had the structure almost > > right before. You want to look through *all* of the target players cards > > and if *none* of

Re: Python: Code is ignoring the if and else

2013-08-02 Thread Terry Reedy
On 8/2/2013 10:24 PM, kevin4f...@gmail.com wrote: Looking at this again, I believe you actually had the structure almost right before. You want to look through *all* of the target players cards and if *none* of them match, (ie the search fails), you want to draw 1 card. What you were missing b

Re: Python: Code is ignoring the if and else

2013-08-02 Thread Dave Angel
kevin4f...@gmail.com wrote: > I'm trying to create a game of Go Fish in Python. But I've stumbled onto a > little problem that I can't seem to figure out how to deal with. > Please list the program the way you are actually running it. The present one will not run very long before producing

Re: Python: Code is ignoring the if and else

2013-08-02 Thread kevin4fong
On Friday, August 2, 2013 7:11:37 PM UTC-7, Joshua Landau wrote: > On 3 August 2013 02:44, wrote: > > > > Yeah, I already know about that. But if I try to change it, I'm not even able > to start the program. If I try to change the if statement that it corresponds > with, I get a an error say

Re: Python: Code is ignoring the if and else

2013-08-02 Thread Joshua Landau
On 3 August 2013 02:44, wrote: > Yeah, I already know about that. But if I try to change it, I'm not even > able to start the program. If I try to change the if statement that it > corresponds with, I get a an error saying "card" is not a global. And if I > try to shift it in, for some reason...t

Re: Python: Code is ignoring the if and else

2013-08-02 Thread Chris Angelico
On Sat, Aug 3, 2013 at 2:44 AM, wrote: > Yeah, I already know about that. But if I try to change it, I'm not even able > to start the program. If I try to change the if statement that it corresponds > with, I get a an error saying "card" is not a global. And if I try to shift > it in, for some

Re: Python: Code is ignoring the if and else

2013-08-02 Thread kevin4fong
On Friday, August 2, 2013 6:42:30 PM UTC-7, Terry Reedy wrote: > Nonsense: they are executed just as you ask, even though what you ask is > > not what you meant. > > > > On 8/2/2013 8:40 PM, kevin4f...@gmail.com wrote: > > > > > def player_0_hitman(hit): > > > for card in pHands[targe

Re: Python: Code is ignoring the if and else

2013-08-02 Thread kevin4fong
On Friday, August 2, 2013 6:39:43 PM UTC-7, John Ladasky wrote: > On Friday, August 2, 2013 5:40:52 PM UTC-7, kevin...@gmail.com wrote: > > > Basically, my code is ignoring the if's and else's. I don't get why. > > > Everything appears to be positioned correctly, but for some odd reason, even

Re: Python: Code is ignoring the if and else

2013-08-02 Thread Terry Reedy
Nonsense: they are executed just as you ask, even though what you ask is not what you meant. On 8/2/2013 8:40 PM, kevin4f...@gmail.com wrote: def player_0_hitman(hit): for card in pHands[target_player]: if target_card[0] == card[0]: count = pHands[target_player].coun

Re: Python: Code is ignoring the if and else

2013-08-02 Thread John Ladasky
On Friday, August 2, 2013 5:40:52 PM UTC-7, kevin...@gmail.com wrote: > Basically, my code is ignoring the if's and else's. I don't get why. > Everything appears to be positioned correctly, but for some odd reason, even > after an if, the program also runs the else as well. Look carefully at y

Re: Python: Code is ignoring the if and else

2013-08-02 Thread MRAB
On 03/08/2013 01:40, kevin4f...@gmail.com wrote: I'm trying to create a game of Go Fish in Python. But I've stumbled onto a little problem that I can't seem to figure out how to deal with. There is a human player (player 0) and three computer players (from 1-3). The human player goes first and