Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,26 +1,8 @@
|
|||
# You can delete from here to SOLVE THE MAZE
|
||||
# if you're appending this to the maze generator code.
|
||||
# Experimental!
|
||||
["+-+-+-+-+-+-+"
|
||||
"|. . .|. . .|"
|
||||
"+-+-+ + + + +"
|
||||
"|.|. .|.|.|.|"
|
||||
"+ + +-+-+ + +"
|
||||
"|.|. . . .|.|"
|
||||
"+ +-+-+-+-+ +"
|
||||
"|. . . . . .|"
|
||||
"+-+-+-+-+-+-+"]
|
||||
H ← 4
|
||||
W ← 6
|
||||
Nfour ← +⊙¤[¯2_0 2_0 0_2 0_¯2] # Gives N4
|
||||
InBounds ← ▽⊸≡(↧⊃(/↧≥1_1|/↧< +1 × 2 H_W))
|
||||
GetWall ← -:⊡1:÷2/-.
|
||||
# S O L V E T H E M A Z E #
|
||||
.
|
||||
~ "maze-generation.ua" ~ GetWall H Maze N₄ W
|
||||
Maze
|
||||
Start ← 1_1
|
||||
End ← -Start ×2 H_W
|
||||
Heur ← /+⌵-End # Manhattan distance.
|
||||
# (pos grid) -> 1-4 next steps, in bounds, without walls in the way.
|
||||
Ns ← ≡⊡1▽:⟜(≡(=@ ⊡)⊙¤≡GetWall)≡⊟¤:InBounds Nfour.
|
||||
astar(Ns|Heur|≍End) Start # Solve (costs = 1 => djikstra)
|
||||
$"_ moves" ⊙⟜(⍜(⊡|+33)):°□⊢
|
||||
End ← -Start ×2 H_W
|
||||
# (pos grid) -> 1-4 next steps, without walls in the way.
|
||||
Ns ← ≡⊡1▽:⟜(≡(=@ ⊡)⊙¤≡GetWall)≡⊟¤⊃⋅∘∘ ⊸N₄
|
||||
path(Ns|≍End) Start # Solve (djikstra)
|
||||
$"_ moves"⧻⟜(∧⍜⊡⋅@O)⊢
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue