aboutsummaryrefslogtreecommitdiff
path: root/console/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'console/main.py')
-rw-r--r--console/main.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/console/main.py b/console/main.py
index dbf414f..f9b7e39 100644
--- a/console/main.py
+++ b/console/main.py
@@ -8,11 +8,19 @@ EMPTY = Fore.LIGHTBLACK_EX + "_" + Fore.RESET
class bord:
def __init__(self, w, h):
- self.board = [[EMPTY for x in range(w)] for u in range(h)]
+ self.width = w
+ self.height = h
+ self.board = [[EMPTY for x in range(self.width)] for u in range(self.height)]
def print(self):
print("\n".join([" ".join(y) for y in self.board]))
+ def outside_board(self, coords):
+ return coords[0] < 0 or \
+ coords[1] < 0 or \
+ coords[0] > self.width - 1 or \
+ coords[1] > self.height - 1
+
def drop_fisje(self, column, disc):
row = -1
for r in range(len(self.board)):