From e814cfe21dafc9e41bc32f642089d6ca313361e4 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Fri, 23 Dec 2022 12:20:48 +0100 Subject: [PATCH] Replace debug function with debug level --- lambdaV.py | 3 --- levels/debug.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 levels/debug.json diff --git a/lambdaV.py b/lambdaV.py index 1df104c..9c9d57d 100644 --- a/lambdaV.py +++ b/lambdaV.py @@ -518,9 +518,6 @@ def setup_and_run_task(start_field, start_position, start_heading, text, allowed print("\nAvailable conditions: "+", ".join(allowed_conditions)) print(evaluate_parser_result(parse_code(input("\nCode: "), allowed_commands, allowed_conditions))) -def debug_setup(): - setup_and_run_task(empty_field, [1,1], cursor_east, "Debug mode", ["step", "left", "right", "take", "repeat", "while", "if"], ["facing north", "facing south", "facing east", "facing west", "in front of wall", "goal reached", "on apple"]) - if __name__ == "__main__": import sys, os, json diff --git a/levels/debug.json b/levels/debug.json new file mode 100644 index 0000000..002a736 --- /dev/null +++ b/levels/debug.json @@ -0,0 +1,35 @@ +{ + "field": [ + " _________________ ", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| |", + "| $|", + " ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ " + ], + "start position": [ 1, 1], + "start heading": "east", + "text": "Debug mode", + "allowed commands": [ + "step", + "left", + "right", + "take", + "repeat", + "while", + "if" + ], + "allowed conditions": [ + "facing north", + "facing south", + "facing east", + "facing west", + "in front of wall", + "goal reached", + "on apple" + ] +}