Hi,
This time I'm trying to make a tic tac toe game. I'm trying to make a game where player is able to choose the size of the board and how many marks is needed in line to win.
I have created a m*n sized board like this:
My problem is that I can't make a function that sets the winning conditions and a function that checks them. This is very hard because there is infinite amount of winning conditions in m*n board where you need k marks in line to win. Can anyone give me any help?
This time I'm trying to make a tic tac toe game. I'm trying to make a game where player is able to choose the size of the board and how many marks is needed in line to win.
I have created a m*n sized board like this:
Code:
import numpy
def new_board(m,n):
row = []
rows = []
for i in range(n):
element = '_'
row.append(element)
for i in range(m):
rows.append(row)
board = numpy.array(rows)
return board
def main():
m = input('Rows: ')
n = input('Columns: ')
board = new_board(m,n)
.
.
.
main()
Comment