Questions about a tic-tac-toe program I am writing
I am making a tic-tac-toe program in python. I have two questions: How to create a trick to terminate the move() when we have created a diagonal or a line(xxx or OOO) in the game. In my program some error is occurring::in line 28::(UnboundLocalError: local variable 'stop' referenced before assignment) My code is:: import random board = {"top-l":" ","top-m":" ","top-r":" ","mid-l":" ","mid-m":" ","mid-r":" ","low-l":" ","low-m":" ","low-r":" "} def print_board(board): print( board["top-l"] + "|" + board["top-m"] + "|" + board["top-r"]) print("--------") print( board["mid-l"] + "|" + board["mid