Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
This tag is for challenges relating to mazes, typically generating or navigating them. This often is used with the [ascii-art] tag, a common method of demonstrating the mazes
3
votes
Generate a one-path maze
JavaScript (ES6), 87 bytes
A recursive function. Outputs a few trailing spaces.
f=(n,w=n,s=' -'[n&1].repeat(w-3),c='|+'[n&1])=>n?`
`+(n&2?c+s+' |':'| '+s+c)+f(n-1,w):s
Test
f=(n,w=n,s=' -'[n& …
6
votes
Multi-level free parking space finder
JavaScript (ES6), 199 bytes
Takes input as an array of arrays of arrays of characters, using the characters described in the challenge. Returns \$0\$ if there's no free parking space.
a=>(m=g=(c,t,f, …
5
votes
ASCII Maze Compression
A maze is encoded as a bit stream which is eventually converted to a string. … Header
The header consists of:
the width \$w\$ on 7 bits
the height \$h\$ on 7 bits
Wall data
We walk through the entire maze and attempt to predict if the next cell is a wall or not, based on the …
7
votes
Interactive Maze Solver
JavaScript (ES6), 180 174 bytes
Uses prompt() to output the direction and retrieve the result.
_=>(g=p=>[...'012301234'].some((d,i)=>g[p]>>d&1|i<4&g[P=[p[0]+(d-2)%2,p[1]+~-d%2]]>0?0:(r=prompt('up/l …
3
votes
1D Hopping Array Maze
Commented
a => // given the maze a[]
(g = ( // g = recursive function taking:
x, // x = current position
p, …
6
votes
Ice Golf Challenge
JavaScript (ES6), 174 bytes
Takes input in curling currying syntax ([x, y])(a), where x and y are the 0-indexed coordinates of the starting position and a[ ] is a matrix of integers, with 0 = ice, 1 = …
4
votes
Minimal cost path in wall-breaking maze
// to 1 and set W to +inf
&& o // return o
The purpose of the last recursive call o = g(-1, W = w, N = n) is to create a copy of the current maze …
5
votes
Can I exit the maze with this many bombs?
Returns false if we can exit the maze, or true if we can't.
m=>g=(b,X=0,Y=0)=>m.every((r,y)=>m[Y+1]||r[X+1]?r.every((v,x)=>r[x]*=v>0|(X-x)**2+(Y-y)**2!=1||g(b-~v,x,y,r[x]=1)):b<0)
Try it online! …