Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- noc = int(input("How many coins do you want to play with?\n"))
- print("Ok",noc,"coins it shall be. Lets lay them all down as 'tails'. The goal is to find out if we can achieve all",noc,"coins showing heads by flipping a set number of coins per turn.\n")
- nof = int(input("How many coins do you want to flip per turn?\n"))
- print("Ok! We have a",noc,"coin game and we will flip",nof,"coins at a time.\n")
- go = input("Press [Enter] and I shall tell you if all the coins can be changed to 'heads.'\n")
- mod_div = noc/nof
- which_turn = noc - nof +1
- turns_left = noc - which_turn
- if noc % nof == 0:
- print("thats easy you can do it in",int(mod_div),"flips")
- print("GAME OVER - PRESS THE PLAY ARROW FOR NEW GAME.\n\n\n\n\n\n\n")
- elif turns_left % 2 == 0:
- print("The last element will change to heads on turn number:", which_turn)
- print("")
- print(noc,"[coin game]-","[last coin changes to heads on turn]", which_turn, "=", turns_left,"turn(s) left\n")
- print("Yes! On flip number", noc,"The coins will turn all heads.\n")
- print("GAME OVER - PRESS THE PLAY ARROW FOR NEW GAME.\n\n\n\n\n\n\n")
- else:
- #if turn_left % 2 != 0:
- print("The last element will turn to heads on turn number :", which_turn)
- print("")
- print(noc,"[coin game]-","[last coin changes to heads on turn]", which_turn, "= ", turns_left,"turn(s) left\n")
- print(turns_left, "is odd..sorry you can't\n")
- print("GAME OVER - PRESS THE PLAY ARROW FOR NEW GAME.\n\n\n\n\n\n\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement