39
votes
31
votes
ASCII Maze Rendering 3000
Python 2, 81 bytes
def f(M,k=1,r='',b=0):
for c in M[k][k::6]:b^=c>' ';r+=' #'[b]
print r;f(M,k+3)
Try it online!
Takes input as a list of strings (or a ...
21
votes
Accepted
A Mouse with Dynamite
Perl, 216 215 bytes
Includes +2 for -0p
Give input on STDIN. Use % for external walls, # ...
20
votes
19
votes
ASCII Maze Rendering 3000
JavaScript (Node.js), 85 bytes
a=>a.flatMap(u=(l,y)=>y%3?[]:[l.flatMap((c,x)=>x<y|(x-=y+3)%6?[]:' #'[u[x]^=c+1<0])])
Try it online!
Basic idea is:...
13
votes
11
votes
Accepted
Find all the coordinates on a path
Slip, 2 + 1 = 3 bytes
+1 byte for the p flag. Code:
`#
Explanation:
The p-flag returns the ...
11
votes
Accepted
11
votes
Constructing an evil maze against random exploration
No dead ends near the entrance, 21,477,560 21,485,005
Try it online!
Yay, 21 million. The giant horizontal segments up to row 19 are also removed, so about 20% of the entire grid is just an open space....
11
votes
10
votes
Generate a one-path maze
Jelly, 36 35 34 33 32 bytes
2*×5H_2Bị⁾ |
_3”-ẋ”+;;Çsẋ2U3¦ṁµY
TryItOnline!
Builds a nighter™ the other way around to the examples like:
...
10
votes
Help Pac-Man count the Pac-Dots
Pyth, 356 345 + 1 = 346 bytes
The code contains some unprintables, so here is the reversible xxd hexdump.
...
10
votes
Largest Compatible Maze
Score: 8066 8065 walls
I found an 8066 wall solution using dynamic programming over solutions that can be recursively decomposed by splitting on a row or column consisting entirely of floors or ...
9
votes
8
votes
Find all the coordinates on a path
MATL, 7 6 5 bytes
This is using 1-based indexing with (1,1) in the top left corner.
oo&fh
Explanation:
...
8
votes
Find all the coordinates on a path
Grime, 5 bytes
pa`\#
Try it online!
The output format is a bit funky, but OP has stated that it's valid.
Explanation
Grime is my 2D pattern matching language.
...
8
votes
Find all the coordinates on a path
Python, 67 bytes
This is actually just a golf of my Stack Overflow answer on a similar topic.
...
8
votes
Accepted
Life is a Maze: We take the wrong Path before we learnt to walk
Retina, 338 281 275 273 261 bytes
...
8
votes
7
votes
Interactive Maze Solver
JavaScript (ES6), 180 174 bytes
Uses prompt() to output the direction and retrieve the result.
...
6
votes
Shortest universal maze exit string
C++ and the library from lingeling
Summary: A new approach, no new solutions, a nice program to play
with, and some interesting results of local non-improvability of the
known solutions. Oh, and some ...
6
votes
Match coordinates with their values
Python, 39 bytes
Takes the inputs:
a list of (x, y) integer coordinates
b list of strings
<...
6
votes
Life is a Maze: We take the wrong Path before we learnt to walk
Python 2: 302 bytes
...
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 ...
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.
...
5
votes
Find all the coordinates on a path
JavaScript (ES6), 70 67 bytes
s=>s.replace(/./g,(c,i)=>c>' '?[i%l,i/-l|0]+' ':'',l=~s.indexOf`
`)
Outputs a newline-and-space-separated list of ...
5
votes
Generate a one-path maze
JavaScript (ES6), 86 92 116
Almost a kolmogorv-complexity challenge ...
With a little lateral thinking (inspired by @Neil's answer), it can be very shorter. Just turn 90°
...
5
votes
5
votes
Accepted
5
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
maze × 47code-golf × 38
path-finding × 14
ascii-art × 13
grid × 10
code-challenge × 6
graph-theory × 6
decision-problem × 3
random × 2
game × 2
optimization × 2
puzzle-solver × 2
array × 2
popularity-contest × 1
graphical-output × 1
king-of-the-hill × 1
chess × 1
polyglot × 1
compression × 1
restricted-time × 1
hexagonal-grid × 1
binary-matrix × 1
answer-chaining × 1
generation × 1
interactive × 1