https://github.com/en10/mazejs
Maze in JS Canvas
https://github.com/en10/mazejs
maze maze-solver png png-decoder
Last synced: 4 months ago
JSON representation
Maze in JS Canvas
- Host: GitHub
- URL: https://github.com/en10/mazejs
- Owner: EN10
- Created: 2017-02-25T12:27:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-02T09:41:32.000Z (over 9 years ago)
- Last Synced: 2025-06-23T05:06:50.763Z (12 months ago)
- Topics: maze, maze-solver, png, png-decoder
- Language: HTML
- Homepage: https://preview.c9users.io/en10/maze/index.html
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Investigation in to Maze solving in JS#
index.html
-
index.html loads tiny.png 10x10 pixel maze
getImageData produces a RGBA array
black is 0,0,0,255 and white is 255,255,255,255
R = G = B so only Red is read
RGBA means length / 4 and i*4
if 0 i.e. black pixel found then use fillRect()
mod (%) used to go to next row
debug.html
-
Zooming PNG is Blurry
Following lines have been commented out in favour of redraw
canvas set to image size
zoom image to fit window height
getImageData doesn't work after scale hence draw before and after scale
pixels2Console() = pixels2Array() & array2Console()
pixels2Array creates a simplified (getImageData) array, may be redundant
References
-
https://preview.c9users.io/en10/maze/index.html
https://www.youtube.com/watch?v=rop0W4QDOUI
https://github.com/mikepound/mazesolving
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas