diff options
| author | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-01-27 12:09:16 +0200 | 
|---|---|---|
| committer | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-01-27 12:09:16 +0200 | 
| commit | c0a0bb30e03be9c47b99d5da848e29a747e9af66 (patch) | |
| tree | e1bbfb9da2c5a8feff6eaf6ea03e24fda1dee7fb /app.py | |
| parent | 628105f4640cb341967aaf9771c7c604d4f7aea5 (diff) | |
Adding autoplay functionality.
Diffstat (limited to 'app.py')
| -rw-r--r-- | app.py | 6 | 
1 files changed, 4 insertions, 2 deletions
| @@ -1,6 +1,6 @@  """ app.py - pääohjelma """  from board import Board, Level -from tui import Tui +from tui import Tui, AutoTui  from game import Game  from bots import BadBot @@ -9,14 +9,16 @@ class App:      """ App - Luokka pääohjelmalle"""      def __init__(self, args=None):          level=Level.BEGINNER +        ui_class=Tui          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 +            ui_class = AutoTui if args.auto else ui_class          self.board = Board(level=level)          self.bot = BadBot() -        self.ui = Tui(self.bot) +        self.ui = ui_class(self.bot)          self.game = Game(self.board,self.ui)      def run(self): |