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)
- German Translation HOT 7
- Fix documentation for developers on how to get code / contribute / make HOT 3
- racecondition on mainWorkspace HOT 4
- Build broken HOT 4
- playground broken on site HOT 5
- Misbehaviour of create "do procedure" HOT 1
- Enhancement: Mutator within block definition HOT 2
- Blocks in toolbox remain grayed-out after dragging block from workspace to toolbox. HOT 1
- Unexpected behaviour from "count with" HOT 2
- Add a speed control to Maze app. HOT 2
- Patch for /trunk/apps/maze/id.html HOT 1
- Block Factory color change bug HOT 1
- Not showing printed messages after a second if/do/else prompt HOT 2
- When blockly is within an absolute positionied div some overlays ware wrong positioned HOT 2
- No right-click menu for set block? HOT 3
- Visualization bug (statement input area in combination with a child block and an comment entry of the child) HOT 1
- Minor bug: procedure renaming HOT 1
- The turtle stops before all code was executed HOT 5
- Turtle tutorial not present on turtle web page HOT 6
- Request: Add functionality to collapse/expand all blocks HOT 5
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.