38
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
Accepted
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
A Mouse with Dynamite
JavaScript, 863 834 785 781 bytes
Saved 29 bytes thanks to ETHproductions
Saved 53 bytes thanks to Jordan
...
13
votes
12
votes
Generating Picture Mazes
Python 3, 1491 Bytes
I found this to be a fun project and very interesting (and somewhat lengthy). When I saw this, I was reminded of the summer I spent exclusively writing and improving a maze ...
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
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 ...
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
The arrow maze escape
CJam, 89 81 bytes
q~"><v^":A2/{f{\*}z}/sA[1W52-52]er:T,,{[52md]51f%0e=1=},:E{[2704{__T=+}*]\-E&},,g
Try it online in the CJam interpreter.
How it ...
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
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
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.
...
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
Accepted
6
votes
Hexagonal maze time!
Python 3, 466 bytes
Would have probably ended up smaller if I used depth-first search or something. This monstrosity uses Dijkstra and is quite fast, but very long.
The code defines a function ...
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 ...
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