Anonymous user
Maze generation: Difference between revisions
→{{header|Julia}}: better code for the printer.
(→{{header|Julia}}: better code for the printer.) |
|||
Line 2,611:
check(bound) = cell -> all([1,1] .<= cell .<= [bound...])
maze(w, h) = walk([i%2|j%2 for i=1:2w+1,j=1:2h+1], 2
function
wall[sum(c-> 2.0^.5(3c[1]+c[2]+3),
filter(x -> maze[x...] != 0,
Line 2,624:
{{out}}
<pre>
julia>
┏━━━━━━━━━━━━━━━┳━━━━━━━┳━━━┳━━━┳━━━━━━━┳━━━┳━━━━━━━━━┳━━━━━┓
┃ ╺━━━┳━━━┓ ╺━━━┛ ╻ ┏━╸ ┃ ╻ ┃ ╻ ┃ ╻ ╺━┳━┛ ╻ ╹ ╺━┓ ╺━┓ ┗━━━╸ ┃
|