Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the ways of the maze #8

Closed
GoogleCodeExporter opened this issue Dec 6, 2015 · 9 comments
Closed

change the ways of the maze #8

GoogleCodeExporter opened this issue Dec 6, 2015 · 9 comments

Comments

@GoogleCodeExporter
Copy link

How change the ways of the maze?
In the Future?

Original issue reported on code.google.com by Lestat...@gmail.com on 3 Jun 2012 at 10:51

@GoogleCodeExporter
Copy link
Author

I know it's just a Blockly demo, but a random maze really would be nice for 
testing solutions. As the maze is predictable, the fastest-to-execute solution 
is FWD FWD LFT FWD .. etc

Original comment by RickMeas...@gmail.com on 4 Jun 2012 at 12:00

@GoogleCodeExporter
Copy link
Author

Shouldn't there be a "finish" block to control when to stop the program?
I could try to solve the problem by always turning to the right or always 
turning to the left (for example), but without a way to tell it to stop, it 
could be crawling the maze forever.

Original comment by damianv...@gmail.com on 4 Jun 2012 at 2:19

@GoogleCodeExporter
Copy link
Author

Do you mean a way to arbitrarily stop, or to finish when you reach the 
destination? In my experience, it does finish when the player hits the 
destination, so there is no need for a finish command. I also don't see a need 
for a finish at an arbitrary time, since you can just hit the "Reset" button 
manually.

Original comment by matt.gi...@gmail.com on 10 Jun 2012 at 3:53

@GoogleCodeExporter
Copy link
Author

Ideally, at least for teaching purposes, blockly would have a demo of how to 
create a new maze so that students could challenge each other on creating mazes 
that could then be saved, shared and then solved by other users.

Original comment by dennisgd...@gmail.com on 11 Jun 2012 at 10:31

@GoogleCodeExporter
Copy link
Author

The "finish" should be in the form of the repeat until block with an "is at 
exit" (or similar) condition.

Original comment by conceptg...@gmail.com on 12 Jun 2012 at 8:39

@GoogleCodeExporter
Copy link
Author

Yes, random maze generation would be a really nice feature!

anyway, this project is awesome! I'm really looking forward to write an 
integration for drupal with this! Thanks so much for this

Original comment by padddy...@gmail.com on 13 Jun 2012 at 10:41

@GoogleCodeExporter
Copy link
Author

Changing the maze is not hard; random would be more difficult. To change the 
maze you edit the matrix in maze.js. The code is all well commented. Unless you 
want to run the maze 'blind', you must also change the map.png graphic to match 
the new matrix, which is just a single image. 

So to create a random (and correct -- there are a certain rules you must follow 
in the matrix to make it solvable) matrix WITH a matching generated image 
behind: that's a hard task.

I created a few diferent mazes that I am attaching here. Note that I made the 
matrix size bigger in most cases. All the outside matrix elements MUST be 
blocks, so the actual size of what you have to work with in building a NxN 
matrix is really (N-1 x N-1). So for the original matrix size of 8x8, there are 
a finite number of buildable mazes and that number is (I am guessing) 
surprising small. (Anyone care to calculate that?)

For the mazes attached here, I have a single fairly elegant/compact solution 
which will solve all, except "bigger3". I'm not attaching the solution!

For opening the attached mazes, in every case, point your browser to the 
"index.html" file. I'm using Safari, and the right-hand frame is visually 
messed up, but functional. If someone with better html/javascript gets a chance 
to improve that, please share!

You'll see that I didn't put a ton of work into the background map.png image 
either!

The matrix size can be even larger of course. For every increment of 2 (i.e., 
as I increased the matrix size from 8x8 to 10x10) the map.png size increases by 
100px. You also need to edit the container size in index.html. So the original 
size is 400 x 400, and in my 'bigger' mazes it is 500 x 500. 

cheers to all, waldo

Original comment by waldo.wi...@gmail.com on 14 Jun 2012 at 5:27

Attachments:

@GoogleCodeExporter
Copy link
Author

in firefox the right frame doesnt work.
is there any fix?

Original comment by Kuche...@googlemail.com on 15 Jun 2012 at 10:06

@GoogleCodeExporter
Copy link
Author

The new "Randomize" button moves the start and end points, as well a the 
starting direction.  There are now 80 different permutations (5 * 4 * 4).  
Enjoy!

Original comment by neil.fra...@gmail.com on 9 Jul 2012 at 6:29

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant