Why does this maze solution fail? (Level 8)

634 views
Skip to first unread message

Austin Bart

unread,
Jan 26, 2016, 3:53:30 PM1/26/16
to Blockly Games
One of my students used the following code for the maze, and it ended up not succeeding. However, the avatar does navigate to the end, runs into the wall, and then fails. Is it because of the second "move forward"?

<xml><block type="maze_moveForward" id="6" x="70" y="70"><next><block type="maze_forever" id="7"><statement name="DO"><block type="maze_moveForward" id="8"><next><block type="maze_if" id="9"><field name="DIR">isPathRight</field><statement name="DO"><block type="maze_turn" id="10"><field name="DIR">turnRight</field></block></statement><next><block type="maze_if" id="11"><field name="DIR">isPathLeft</field><statement name="DO"><block type="maze_turn" id="12"><field name="DIR">turnLeft</field></block></statement><next><block type="maze_moveForward" id="13"><next><block type="maze_if" id="14"><field name="DIR">isPathRight</field><statement name="DO"><block type="maze_turn" id="15"><field name="DIR">turnRight</field></block></statement></block></next></block></next></block></next></block></next></block></statement></block></next></block></xml>


Neil Fraser

unread,
Jan 26, 2016, 9:56:46 PM1/26/16
to Austin Bart, Blockly Games
Yes.  This is an interesting issue.

Originally the maze would terminate the program as soon as the goal was reached -- regardless of where the execution point was at that moment.  The result was periodic letters from CS teachers arguing that we were teaching programming wrong and that the loop should only check at the start of each iteration.  So we changed the execution model accordingly.  Now we get periodic letters from CS teachers arguing that the program should terminate immediately at the goal.

There doesn't seem to be a way to keep both camps happy.  However, so far there has been a completely consistent divide in the national origins of the two requests.  Perhaps we should use the forgiving execution model for the English version, and the strict execution model for the other language versions.

--
You received this message because you are subscribed to the Google Groups "Blockly Games" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly-game...@googlegroups.com.
To post to this group, send email to blockl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly-games/7954ac70-1e90-41c5-867f-8f6eaa72cfe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Austin Bart

unread,
Jan 26, 2016, 10:20:50 PM1/26/16
to Neil Fraser, Blockly Games
Very interesting indeed. I did mention to the student that their solution was overly complex. One thought that comes to mind is to check the students' solution and mention if it's overly complex, possibly even demanding that they simplify it. I doubt that will satisfy all the teachers, of course, but it seems like it might be helpful for students who are ending up with over-complicated solutions.

~Cory
--
Austin Cory Bart
Computer Science PhD student at Virginia Tech
Reply all
Reply to author
Forward
0 new messages