Skip to content

Commit

Permalink
game state
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Wohl committed Dec 4, 2019
1 parent c337394 commit 274f8ab
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class State:
def __init__(self):
self.nrows = 18
self.ncols = 18
self.board = []
self.setup()

def setup(self):
for row in range(self.nrows):
self.board.append([])
for col in range(self.ncols):
if((row + col) % 2 == 0):
self.board[row].append("B")
else:
self.board[row].append("W")

def __str__(self):
string = ""
for row in range(self.nrows):
string += str(self.board[row]) + "\n"
return string


0 comments on commit 274f8ab

Please sign in to comment.