Iterative Refinement, cont.
Refinement A (using wall-length distance)
/* There are n2 rooms arranged in an n-by-n grid. Some adjacent rooms have connecting doors. No doors lead outside. You are in the upper-leftmost room facing left. A sequence of doors leads to the lower-rightmost room. Get there. */
while ( you are not in lower rightmost room )
/* Get at least one wall �closer� to
if (you are facing a door){
Turn 90 degrees counter-clockwise;
Turn 90 degrees clockwise;