From 4c3c3f973e17ee9441fb16cca31828e0e84365c4 Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Mon, 6 Sep 2021 00:34:26 +0200 Subject: [PATCH] implemented stepping mode --- gauss-turing/webserver/gauss_turing.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gauss-turing/webserver/gauss_turing.py b/gauss-turing/webserver/gauss_turing.py index d1d7fd2..e033a91 100644 --- a/gauss-turing/webserver/gauss_turing.py +++ b/gauss-turing/webserver/gauss_turing.py @@ -420,6 +420,9 @@ class Game: elif event.key == pygame.K_r: # run program self.state = 'running' + elif event.key == pygame.K_s: + self.state = 'manual' + self.prg.step() return self.state def reset(self): @@ -442,6 +445,8 @@ class Game: self.state = self.reset() elif self.state == 'quit': running = False + elif self.state == 'manual': + pass else: print("unknown state") return @@ -452,4 +457,8 @@ class Game: if __name__ == "__main__": random.seed(42) game = Game(dimx=7, dimy=4, robotx=3, roboty=1) - game.run() \ No newline at end of file + game.run() + +# TODOs +# - in stepping mode (s) it is possible to drive outside of the map +# - when no P0 command is present the program counter will overflow \ No newline at end of file