Advertisement
otorp2

Untitled

Mar 29th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. noc = int(input("how many coins do you want to play with? "))
  2. print("ok",noc,"coins it shall be")
  3. nof = int(input("now how many coins per flip? "))
  4. print("super! We shall flip", nof, "coins at a time", "that's", noc,"coins by",nof,"flips")
  5. go = input("type the word go and I shall tell you if the game can be done ")
  6.  
  7.  
  8. which_turn = noc - nof +1
  9. turns_left = noc - which_turn
  10.  
  11. if noc / nof == 2:
  12. print("thats easy you can do it in 2 flips")
  13.  
  14. elif turns_left % 2 == 0:
  15. print("the last element will turn heads on turn number :", which_turn)
  16. print("")
  17. print(noc, "subtract ", which_turn, "= ", turns_left)
  18. print("")
  19. print("you can")
  20.  
  21. else:
  22. #if turn_left % 2 != 0:
  23. print("the last element will turn heads on turn number :", which_turn)
  24. print("")
  25. print(noc, "subtract ", which_turn, "= ", turns_left)
  26. print("")
  27. print(turns_left, "is odd..sorry you cant")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement