Replace debug function with debug level

master
BodgeMaster 2022-12-23 12:20:48 +01:00
parent e3475eefc3
commit e814cfe21d
2 changed files with 35 additions and 3 deletions

View File

@ -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

35
levels/debug.json Normal file
View File

@ -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"
]
}