My coursework is to create Tic Tac Toe in Python, my tutor helped me get it working in 2.7 however It needs to be in 3.5.
Firstly in 2.7 the code below prints a 3x3 list, however in 3.5 it just prints the list downwards not 3x3. my tutor said maybe put end = ' '
at the end but that also doesn't work.
def printBoard( board ):
counter = 0
for y in range(3):
for x in range(3):
print (board[counter]),
counter += 1
print
print
second problem is on 2.7 it allows me to continue to input numbers till the board is filled with X or O, on 3.5 it only allows to input once and then the program ends?
value = input("input number between 1 and 9")
value = int(value)
if value == 1:
alist[0] = player1
printBoard( alist )
value = input("input number between 1 and 9")
if value == 2:
alist[1] = player1
printBoard( alist )
value = input("input number between 1 and 9")
etc.