summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-27 11:29:45 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-27 11:29:45 +0200
commit628105f4640cb341967aaf9771c7c604d4f7aea5 (patch)
tree4abf790dceb767c47cfdff3346350efd06f91c3d /app.py
parent0e7d9158e4cc6ac51bfab2fa394009dc611e6e6e (diff)
Implementing level selection from commmand line.
Diffstat (limited to 'app.py')
-rw-r--r--app.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/app.py b/app.py
index 70dbd03..1770c25 100644
--- a/app.py
+++ b/app.py
@@ -7,8 +7,14 @@ from bots import BadBot
# pylint: disable = too-few-public-methods
class App:
""" App - Luokka pääohjelmalle"""
- def __init__(self):
- self.board = Board(level=Level.BEGINNER)
+ def __init__(self, args=None):
+ level=Level.BEGINNER
+ if args:
+ level = Level.EXPERT if args.expert else level
+ level = Level.INTERMEDIATE if args.intermediate else level
+ level = Level.BEGINNER if args.beginner else level
+
+ self.board = Board(level=level)
self.bot = BadBot()
self.ui = Tui(self.bot)
self.game = Game(self.board,self.ui)