Replace debug function with debug level
parent
e3475eefc3
commit
e814cfe21d
|
@ -518,9 +518,6 @@ def setup_and_run_task(start_field, start_position, start_heading, text, allowed
|
||||||
print("\nAvailable conditions: "+", ".join(allowed_conditions))
|
print("\nAvailable conditions: "+", ".join(allowed_conditions))
|
||||||
print(evaluate_parser_result(parse_code(input("\nCode: "), allowed_commands, 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__":
|
if __name__ == "__main__":
|
||||||
import sys, os, json
|
import sys, os, 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"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue