Giter Club home page Giter Club logo

Comments (9)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 4 Jun 2012 at 12:00

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 4 Jun 2012 at 2:19

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 10 Jun 2012 at 3:53

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 11 Jun 2012 at 10:31

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
The "finish" should be in the form of the repeat until block with an "is at 
exit" (or similar) condition.

Original comment by [email protected] on 12 Jun 2012 at 8:39

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 13 Jun 2012 at 10:41

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 14 Jun 2012 at 5:27

Attachments:

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
in firefox the right frame doesnt work.
is there any fix?

Original comment by [email protected] on 15 Jun 2012 at 10:06

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
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 [email protected] on 9 Jul 2012 at 6:29

  • Changed state: Fixed

from blockly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.