I write a code for tic tac toe game. In this code, I have a loop and I insert a function into this loop called WinandTie() which controls the winning and draw situation. If even one condition of WinandTie() is met, i want to stop to loop. I know how to stop the loop (break) but i dont know how to control the winning and draw situations by using the WinandTie() function. How can i fix it?
Here is the code:
for i in range(counter):
while True:
if playeronecoordination == "1,1":
listone[1] = " " + playeronesign
if WinandTie():
break
else:
field()
playertwocoordination = str(input("player two, give the coordinates"))
break
if WinandTie() part is operable, it turns a response in a different python file with the same required parameters. However, does not turn a response and break the loop in this situation.