Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Number of app's lang-manu HOT 2
- turtle trail does not show on Android Nexus 10
- Blockly.Xml.workspaceToDom doesn´t work on Safari HOT 2
- context menu on tablets HOT 1
- Non Printing Text Characters
- [deleted issue]
- [deleted issue]
- Color dropdowns not listening for touch events HOT 1
- Trashcan Lid animation uses CPU when idle HOT 1
- Uncollapsing duplicated block "Connection already in database" error HOT 2
- Code blocks can become misaligned when moving a set of blocks with a "break out of loop" attached to it out of a loop HOT 1
- Mouse wheel scrolling fails to scroll blockly scroll bars up or down HOT 1
- Blocky GUI is pushed from view when a long text string is entered into a block HOT 1
- If block breaks when click on the star. HOT 1
- Blockly games not running correctly on chrome! HOT 4
- Headless blockly doesn't work for function/procedure calls with parameters HOT 1
- How to create types to restrict connections between few custom blocks? HOT 1
- change name on google + HOT 1
- Left-Right-Up-Down movement in Blockly JS HOT 1
- testing window['Audio'] is not sufficient HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockly.