>>9
I once wrote a wc2 clone using it, but a-star pathfinding turned to be slow.
aStar L S F H P = !VsI+1 = u 0:[S ø 0] |
<:next [[_ O]@Os] = C:O,0 = G:O,2
= {f C = O,<[N P:y? @_]=[@P,r N]> // backtrace path
;√ = {G≤L = NG:G+1 = k P C,cell.neibs
| F <N = I:N,cellIndex
= {(aget I Vs)≤≥VsI = hIns (H NG+N) [N O NG] !Os
= aset I VsI Vs}>}
= next Os}>