aroberge / reeborg

Enhanced Karel-the-robot clone
http://reeborg.ca/reeborg.html
Other
47 stars 36 forks source link

Find a way to allow done() even if post-code is present #428

Closed aroberge closed 6 years ago

aroberge commented 6 years ago

There should be a way to allow done() even if post-code is present.

One way might be something like

try:
    exec_code(pre+user+post)
except Exception as e:
   record_exception = e

if RUR.state.done_executed:
    try:
        exec_code(post)
    except Exception as e:
        record_exception = e

both with Python and the corresponding Javascript version.