All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Unbounded Maze (Posted on 2008-01-18) Difficulty: 3 of 5
A programmable robotic mouse is placed at an intersection on a square grid, the borders of which are extendable as needed.

From its initial location the mouse moves one cell forward. It turns right with its next move incrementing by 1.

This incremental process continues up to a certain constraint whereby the mouse resumes the process with a move of one space until that constraint is met again; continue this process until you either return to your starting position or you evidently will never return.

What generalisations can be made about how variations of the value of the constraint affect the path forced upon the mouse?

M

Note:It will be necessary to test a range of constraining values.

See The Solution Submitted by brianjn    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): Revision | Comment 17 of 19 |
(In reply to re: Revision by Charlie)

L must be at least 4 to allow for sequences of moves to return to the starting point wherever possible, any higher value merely retraces pathes already laid.

z is the length of pixels assigned to a 'step'.  In the SUB startpos z is assigned the value of 18 (it could be 24, 30, ...) but it is easier to manipulate than fiddle with wider possibilites that the second z assignment does in part.

Swapping the labels, CASE 2 and CASE 4 will create the right turn orientation, and so match the puzzle text.  The original program was written as correction/checking aid for students, and I guess my instruction to them was "turn left".  Well, in due course, I posed the problem here and didn't consider that factor when posting the code for those with access to Qbasic.exe.

Now, by changing the orientation does mean that 'startpos'  x and y coordinate values do need adjusting.  In the last few lines of the program list, x=320 and y=240 need altering for the centre of SCREEN 12.  The values within the following IF conditions would simiarly need to be adjusted.

That the orientation is "wrong" does not perturb me since it was not required for the solution, but it would have been nice had things correlated.

  Posted by brianjn on 2008-01-26 21:34:57

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information