From c0a0bb30e03be9c47b99d5da848e29a747e9af66 Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Sat, 27 Jan 2024 12:09:16 +0200 Subject: Adding autoplay functionality. --- app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index 1770c25..6a2b00a 100644 --- a/app.py +++ b/app.py @@ -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): -- cgit v1.2.3