Im distinguishing 2 players in TicTacToe by utilising MOD, which is used upon an incrementing for loop. Im having trouble incrementing the foor loop within a nested if statement.
for i in range (1,10):
if i % 2==1:
#1st row
if click[0]<=250 and click[0]>=100 and click[1]<=250 and click[1]>=100:
current_game[0][0] = "X"
i+=1
elif click[0]<=550 and click[0]>=250 and click[1]<=250 and click[1]>=100:
current_game[0][1] = "X"
i += 1
elif click[0]<=700 and click[0]>=550 and click[1]<=250 and click[1]>=100:
current_game[0][2] = "X"
i += 1
#2nd row
elif click[0]<=250 and click[0]>=100 and click[1]<= 550and click[1]>=250:
current_game[1][0] = "X"
i += 1
elif click[0]<=550 and click[0]>=250 and click[1]<=550 and click[1]>=250:
current_game[1][1] = "X"
i += 1
elif click[0] <= 700 and click[0] >= 550 and click[1] <= 550 and click[1] >= 250:
current_game[1][2] = "X"
i += 1
#3rd row
elif click[0]<=250 and click[0]>=100 and click[1]<= 700and click[1]>=550:
current_game[2][0] = "X"
i += 1
elif click[0] <= 550 and click[0] >= 250 and click[1] <= 700 and click[1] >= 550:
current_game[2][1] = "X"
i += 1
elif click[0] <= 700 and click[0] >= 550 and click[1] <= 700 and click[1] >= 550:
current_game[2][2] = "X"
i += 1
elif i % 2==0:
# 1st row
if click[0] <= 250 and click[0] >= 100 and click[1] <= 250 and click[1] >= 100:
current_game[0][0] = "o"
i += 1
elif click[0] <= 550 and click[0] >= 250 and click[1] <= 250 and click[1] >= 100:
current_game[0][1] = "o"
i += 1
elif click[0] <= 700 and click[0] >= 550 and click[1] <= 250 and click[1] >= 100:
current_game[0][2] = "o"
i += 1
# 2nd row
elif click[0] <= 250 and click[0] >= 100 and click[1] <= 550 and click[1] >= 250:
current_game[1][0] = "o"
i += 1
elif click[0] <= 550 and click[0] >= 250 and click[1] <= 550 and click[1] >= 250:
current_game[1][1] = "o"
i += 1
elif click[0] <= 700 and click[0] >= 550 and click[1] <= 550 and click[1] >= 250:
current_game[1][2] = "o"
i += 1
# 3rd row
elif click[0] <= 250 and click[0] >= 100 and click[1] <= 700 and click[1] >= 550:
current_game[2][0] = "o"
i += 1
elif click[0] <= 550 and click[0] >= 250 and click[1] <= 700 and click[1] >= 550:
current_game[2][1] = "o"
i += 1
elif click[0] <= 700 and click[0] >= 550 and click[1] <= 700 and click[1] >= 550:
current_game[2][2] = "o"
i += 1
I want to be able to increment the for loop if someone clicks on a certain co-ordinate space.
for i in range (1,10):withwhile i<10and addi =1before that.