Guest User

Untitled

a guest
Feb 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. print("this game is kayles game --> it's about every player choose 1 or 2 numbers and the one who choose the last number wins")
  2. a =[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
  3. print(a)
  4. while a!=['.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.']:
  5. print("who will start the game player 1 or player 2")
  6. the_player=int(input())
  7. while the_player==1:
  8. print("player one's turn")
  9. print("choose one or two numbers")
  10. choosen_numbers=int(input())
  11. if choosen_numbers==1:
  12. print("choose the number from",a)
  13. a[(int(input()))]='.'
  14. print(a)
  15. elif choosen_numbers==2:
  16. print("choose the two numbers from",a)
  17. print("choose the first number")
  18. a[(int(input()))]='.'
  19. print("choose the second number")
  20. a[(int(input()))]='.'
  21. print(a)
  22. while choosen_numbers!=1 and choosen_numbers!=2:
  23. print("you're not allow to choose this number please choose 1 or 2")
  24. choosen_numbers=int(input())
  25. if choosen_numbers==1:
  26. print("choose the number from",a)
  27. a[(int(input()))]='.'
  28. print(a)
  29. elif choosen_numbers==2:
  30. print("choose the two numbers from",a)
  31. print("choose the first number")
  32. a[(int(input()))]='.'
  33. print("choose the second number")
  34. a[(int(input()))]='.'
  35. print(a)
  36. if a==['.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.']:
  37. print("player one is the winner")
  38. break
  39. print("player two's turn")
  40. print("choose one or two numbers")
  41. choosen_numbers=int(input())
  42. if choosen_numbers==1:
  43. print("choose the number from",a)
  44. a[(int(input()))]='.'
  45. print(a)
  46. elif choosen_numbers==2:
  47. print("choose the two numbers from",a)
  48. print("choose the first number")
  49. a[(int(input()))]='.'
  50. print("choose the second number")
  51. a[(int(input()))]='.'
  52. print(a)
  53. while choosen_numbers!=1 and choosen_numbers!=2:
  54. print("you're not allow to choose this number please choose 1 or 2 ")
  55. choosen_numbers=int(input())
  56. if choosen_numbers==1:
  57. print("choose the number from",a)
  58. a[(int(input()))]='.'
  59. print(a)
  60. elif choosen_numbers==2:
  61. print("choose the two numbers from",a)
  62. print("choose the first number")
  63. a[(int(input()))]='.'
  64. print("choose the second number")
  65. a[(int(input()))]='.'
  66. print(a)
  67. if a==['.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.']:
  68. print("player two is the winner")
  69. break
  70. while the_player==2:
  71. print("player two's turn")
  72. print("choose one or two numbers")
  73. choosen_numbers=int(input())
  74. if choosen_numbers==1:
  75. print("choose the number from",a)
  76. a[(int(input()))]='.'
  77. print(a)
  78. elif choosen_numbers==2:
  79. print("choose the two numbers from",a)
  80. print("choose the first number")
  81. a[(int(input()))]='.'
  82. print("choose the second number")
  83. a[(int(input()))]='.'
  84. print(a)
  85. while choosen_numbers!=1 and choosen_numbers!=2:
  86. print("you're not allow to choose this number please choose 1 or 2" )
  87. choosen_numbers=int(input())
  88. if choosen_numbers==1:
  89. print("choose the number from",a)
  90. a[(int(input()))]='.'
  91. print(a)
  92. elif choosen_numbers==2:
  93. print("choose the two numbers from",a)
  94. print("choose the first number")
  95. a[(int(input()))]='.'
  96. print("choose the second number")
  97. a[(int(input()))]='.'
  98. print(a)
  99. if a==['.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.']:
  100. print("player two is the winner")
  101. break
  102. print("player one's turn")
  103. print("choose one or two numbers")
  104. choosen_numbers=int(input())
  105. if choosen_numbers==1:
  106. print("choose the number from",a)
  107. a[(int(input()))]='.'
  108. print(a)
  109. elif choosen_numbers==2:
  110. print("choose the two numbers from",a)
  111. print("choose the first number")
  112. a[(int(input()))]='.'
  113. print("choose the second number")
  114. a[(int(input()))]='.'
  115. print (a)
  116. while choosen_numbers!=1 and choosen_numbers!=2:
  117. print("you're not allow to choose this number please choose 1 or 2" )
  118. choosen_numbers=int(input())
  119. if choosen_numbers==1:
  120. print("choose the number from",a)
  121. a[(int(input()))]='.'
  122. print(a)
  123. elif choosen_numbers==2:
  124. print("choose the two numbers from",a)
  125. print("choose the first number")
  126. a[(int(input()))]='.'
  127. print("choose the second number")
  128. a[(int(input()))]='.'
  129. print(a)
  130. if a==['.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.']:
  131. print("player one is the winner")
  132. break
Add Comment
Please, Sign In to add comment