Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- str = input("Enter pole> ")
- print(f"""{"-" * 9}
- | {str[0]} {str[1]} {str[2]} |
- | {str[3]} {str[4]} {str[5]} |
- | {str[6]} {str[7]} {str[8]} |
- {"-" * 9}""")
- for b, s in [[0, 1], [3, 1], [6, 1], [0, 3], [1, 3], [2, 3], [0, 4], [2, 2]]:
- h = "".join([str[i] for i in range(b, b + s * 3, s)])
- if "XXX" in h:
- print("X win")
- exit()
- elif "OOO" in h:
- print("O win")
- exit()
- if str.count("_"):
- print("Not finished yet")
- else:
- print("draw")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement