koteitan / fractalblockmaze

fractal block maze

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fractal block maze

Fractal block mazes are the recursive maze created by omeometo.

This is the javascript to solve them by iterative deepening for the depth.

play here online:

howto:

  • left-side (or upper-side in vertical arrangement) is a fractal generating pattern.
  • right-side (or lower-side) is a fractal block maze generated by the pattern.
  • the start of the maze is the lower-edge.
  • the goal of the maze is the upper-edge.
  • colors:
    • black cells are walls.
    • white cells are empty.
    • pink cells are the cells in a openlist (searching cells).
    • pale pink cells are the cells in a closelist (searched cells).
    • blue cells are the found solution path from start to goal.
  • operations:
    • left-click or drag on the generating pattern:
      • toggle the cell's color.
    • left-click on the maze:
      • zoom in one depth
    • right-click on the maze(or press zoom out button):
      • zoom out one depth
  • interfaces:
    • unit: the number of the parts an edge of the black cell has.
    • draw depth: the drawn depth.
    • solver depth: the maximum depth in that the solver searches the solution.
    • solver status: the status display.
    • pause: pause solver.
    • reset: reset solver.

Algorithm:

  • v1.17b (beta version):
    • path search algorithm:
      • search every white cells in 4-neighbor in [solver depth] depth and put them in the openlist.
      • if there is a black cell in 4-neighbor and there is a white cell in 4-neighbor of the black cells and the solver got a inner path to go thru to the white cell, put it in the openlist.
    • inner path findings:
      • when the solver reachs to the left-end in depth 1, it gets down<->left inner path.
      • when the solver reachs to the right-end in depth 1, it gets down<->right inner path.
    • cost function of openlist:
      • the depth of the cells are the costs of the cells. (the deeper depth is the larger costs)
  • v1.11:
    • path search algorithm:
      • search every white cells in 4-neighbor in [solver depth] depth and put them in the openlist.
    • cost function of openlist:
      • the distance between upper-edge of the maze and upper-edge position is the costs. (the upper is the lower costs.)

Reference

About

fractal block maze

License:MIT License


Languages

Language:JavaScript 91.5%Language:HTML 8.5%