Question: Hi I need some more help with Python coding here is my code print (welcome to Pick Up Sticks ) print (Each player takes turn

 Hi I need some more help with Python coding here is

Hi I need some more help with Python coding here is my code

print ("welcome to Pick Up Sticks ") print ("Each player takes turn picking up from 1") print ("to 4 sticks from a pile of 13 sticks.") print ("whoever picks up the last stick wins.") print ("There are 13 stick(s) left.") print("how many sticks will you take?") print ("Player 1 ") totalSticks = 13 maxSticks= 4 minSticks = 1 #Loop until totalSticks > 0 while totalSticks > 0: sticksSelected= int (input()) #if stick is not in the given range ask user again while sticksSelected maxSticks: print("You cannot take", SticksSelected, "sticks") sticksSelected= int (input()) #you have to substract sticks selected by user totalSticks = totalSticks - sticksSelected #if totalsticks are less than maxSticks then change the maxSticks to totalSticks so that total sticks would not go in negative if totalSticks

it is not working right the introduction works okay however the game isn't working it supposed to start with

player 1 how many sticks will you select player 1 types in 4 and then it said there are 9 sticks left then it goes to player 2 how many sticks will you take player 2 types in 9 and that won't work and then player 2 type in 6 that won't work either and then player 2 types in 2 That leaves the message of there are 7 sticks left and then player 1 types in 1 leaving 6 and then player 2 types in 3 leaving 3 sticks and then player 1 types in 3 making player 1 the winner .

File Edit Shell Debug Options Windows Help Welcome to Pick Up Sticks. Each player takes turns picking up from 1 to 4 sticks from a pile of 13 Buicks. Whoever picks up the last stick wins. There are 13 sticka) lett. Player 1 - how many sticks will you take 4 There are 9 stick (3) lett

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!