Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # krestiki noliki
- pole_for_krestiki = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
- print('Field for the game : - ')
- for i in pole_for_krestiki:
- print(i)
- print('First should be zero and the second if exit ')
- while True:
- print('Print your step ')
- step_i = int(input())
- step_j = int(input())
- if pole_for_krestiki[step_i - 1][step_j - 1] != str:
- pole_for_krestiki[step_i - 1][step_j - 1] = 'ZERO'
- else:
- print('That field is not empty')
- print('Your field now is : ')
- for i in pole_for_krestiki:
- print(i)
- if pole_for_krestiki[0][0] == pole_for_krestiki[1][1] == pole_for_krestiki[2][2] == 'ZERO':
- print('Zero won the game')
- break
- elif pole_for_krestiki[0][2] == pole_for_krestiki[1][1] == pole_for_krestiki[2][0] == 'ZERO':
- print('Zero won the game')
- break
- elif pole_for_krestiki[0][0] == pole_for_krestiki[0][1] == pole_for_krestiki[0][2] == 'ZERO':
- print('Zero win the game')
- break
- elif pole_for_krestiki[1][0] == pole_for_krestiki[1][1] == pole_for_krestiki[1][2] == 'ZERO':
- print('Zero win the game ')
- break
- elif pole_for_krestiki[2][0] == pole_for_krestiki[2][1] == pole_for_krestiki[2][2] == 'ZERO':
- print('Zero won the game')
- break
- elif pole_for_krestiki[0][0] == pole_for_krestiki[1][0] == pole_for_krestiki[2][0] == 'ZERO':
- print('Zero won the game ')
- break
- elif pole_for_krestiki[0][1] == pole_for_krestiki[1][1] == pole_for_krestiki[2][1] == 'ZERO':
- print('Zero won the game')
- break
- elif pole_for_krestiki[0][2] == pole_for_krestiki[1][2] == pole_for_krestiki[2][2] == 'ZERO':
- print('Zero won the game')
- break
- print('Now its start for exit step ')
- print('Now print your step ')
- step_for_exit_i = int(input())
- step_for_exit_j = int(input())
- if pole_for_krestiki[step_for_exit_i - 1][step_for_exit_j - 1] != int:
- pole_for_krestiki[step_for_exit_i - 1][step_for_exit_j - 1] = 'EXIT'
- else:
- print('That field is not empy')
- print('Now field is -- > ')
- for i in pole_for_krestiki:
- print(i)
- if pole_for_krestiki[0][0] == pole_for_krestiki[1][1] == pole_for_krestiki[2][2] == 'EXIT':
- print('Exit won the game')
- break
- elif pole_for_krestiki[0][2] == pole_for_krestiki[1][1] == pole_for_krestiki[2][0] == 'EXIT':
- print('Exit won the game')
- break
- elif pole_for_krestiki[0][0] == pole_for_krestiki[0][1] == pole_for_krestiki[0][2] == 'EXIT':
- print('Exit win the game')
- break
- elif pole_for_krestiki[1][0] == pole_for_krestiki[1][1] == pole_for_krestiki[1][2] == 'EXIT':
- print('Exit win the game ')
- break
- elif pole_for_krestiki[2][0] == pole_for_krestiki[2][1] == pole_for_krestiki[2][2] == 'EXIT':
- print('Exit won the game')
- break
- elif pole_for_krestiki[0][0] == pole_for_krestiki[1][0] == pole_for_krestiki[2][0] == 'EXIT':
- print('Exit won the game ')
- break
- elif pole_for_krestiki[0][1] == pole_for_krestiki[1][1] == pole_for_krestiki[2][1] == 'EXIT':
- print('Exit won the game')
- break
- elif pole_for_krestiki[0][2] == pole_for_krestiki[1][2] == pole_for_krestiki[2][2] == 'EXIT':
- print('Exit won the game')
- break
Advertisement
Add Comment
Please, Sign In to add comment