Hi. I've got a question on PS3b. I've attached the code. My question is about the play_games function(toward the bottom of the code): Under the "if choose == 'n' or choose == 'r':" How can I get the program to produce a new handz (randomly generated hand) when the user selects 'n', but keep the previous handz (the hand that was generated on the previous while loop) when the user selects 'r'? Right now when the user selects 'r', handz generates a new random hand.
pls use line numbers when referring to lines of code so we can find them easier. maybe use if/elif/else?? http://pastie.org/4900295 http://docs.python.org/reference/compound_stmts.html#the-if-statement
Thanks bwCA. The code I am referring to is in 425-434. http://pastebin.com/H6vpKqGd Here is the result I am getting. http://pastebin.com/4sVCLSK5 After I enter 'n' in the raw_input, the program generates a new random hand(line 6). Then after the play_hand functions runs (line 8) the program goes to the beginning of the while loop (line 9). At this point when I enter 'r', I would like the program to show the same hand in line 6. but instead it shows a new one (line 10). How can I fix this problem and get 'r' to produce the same hand as 'n'?
what is line 388 doing?
Yep you are right line 388 is the culprit. I was assigning hand to deal_hand in the play_hand function which results in a new random hand every time its run. Thank you for your help.
Join our real-time social learning platform and learn together with your friends!