<-- if interrupted here, coordinates are valid and turtle hasn't moved
2) Request the turtle to move with turtle.native.
<-- if interrupted here, the turtle will fire a success or failure event after it restarts, and coordinates are wrong if it succeeded.
3) Wait 0.05 (or 0.1?) seconds for a failure event. If you get one, go to step 6
<-- if interrupted here, the turtle will fire a success event after it restarts, and coordinates are wrong if it succeeded.
4) Update your coordinates. Record the fact that you haven't received a success event yet.
<-- if interrupted here, the turtle will fire a success event after it restarts, and coordinates are valid.
5) Wait for a success event.
<-- if interrupted here, the turtle will not fire an event after it restarts, and coordinates are valid.
6) Reset the file.
When loading:
if file has "intention to move" flag then if file has "updated coordinates but didn't receive success event" flag then: wait for success event, failure event or one second if failure event then crash - something screwed up end else wait for success event, failure event or one second if timed out then crash - something screwed up end if success event then update coordinates with direction of movement end end end
Btw, that's three file writes per block moved.












