Skip to main content
Share Your Experience: Take the 2024 Developer Survey
55 votes
Accepted

Is my prison secure?

Snails, 13 bytes !(t\P(o\ ),o~ Try it online! Prints 0 for insecure prisons and the size of the input's bounding box for ...
Martin Ender's user avatar
39 votes

Hexagonal maze time!

Hexagony, 2437 bytes The long-awaited program is here: ...
boboquack's user avatar
  • 2,317
21 votes
Accepted

A Mouse with Dynamite

Perl, 216 215 bytes Includes +2 for -0p Give input on STDIN. Use % for external walls, # ...
Ton Hospel's user avatar
  • 14.9k
18 votes

Island Golf #1: Circumnavigation

Mathematica (version 9), 165 bytes The nice, short ConvexHullMesh function that Greg Martin used was only introduced in Mathematica version 10, so I thought I'd ...
Not a tree's user avatar
  • 3,206
16 votes

Is my prison secure?

C# (.NET Core), 485 480 474 470 421 408 bytes The absolutely wrong tool and approach, but nonetheless... 7 bytes (and more) saved with the useful tips from TheLethalCoder. 4 bytes saved by returning ...
Charlie's user avatar
  • 12.9k
15 votes

Is my prison secure?

Perl 5, 69 bytes -10 bytes thanks to @Grimy. -2 bytes thanks to @Neil. 77 byte of code + -p0 flags. ...
Dada's user avatar
  • 8,483
15 votes

Weight of the Least Weighted RoD Path

J, 42 bytes v(+}.<.}:)&.>/@{.[:</.(2#v=._1+1#.$){.!._] Try it online! How it works ...
Bubbler's user avatar
  • 76.7k
14 votes
Accepted

Find the right path

Slip, 47 bytes `a(?,[`-+]*((`/<|`\>)[`|+]*(`/>|`\<)[`-+]*)*`:) Test it here. Yay for undocumented features... Explanation Slip is basically a two ...
Martin Ender's user avatar
14 votes
Accepted

A Turtle Finds a Portal

JavaScript (ES7),  140 139  138 bytes Takes input as a matrix of integers with the following mapping: \$-1\$ = 🔵 (any portal) \$0\$ = \$X\$ (empty) \$1\$ = 🌄 (mountain) \$2\$ = 🐢 (turtle) \$3\$ = �...
Arnauld's user avatar
  • 193k
13 votes

A Mouse with Dynamite

JavaScript, 863 834 785 781 bytes Saved 29 bytes thanks to ETHproductions Saved 53 bytes thanks to Jordan ...
DanTheMan's user avatar
  • 4,105
13 votes

Life is a Maze: We take the wrong Path before we learnt to walk

Perl 6, 259 295 bytes ...
smls's user avatar
  • 4,430
13 votes

Is there a left-right connection?

MATLAB/Octave, 115 109 98* bytes -6 bytes thanks to Luis Mendo -7 bytes thanks to Luis Mendo ...
elementiro's user avatar
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 ...
Anonymous No Lifer's user avatar
12 votes

Unlock your Lock

Python 2, 113 107 105 99 95 bytes a,b=input() i=0 print a for x in a: while x-b[i]:a[i]=x=(x+(x-b[i])%10/5*2-1)%10;print a i+=1 Try it online! Takes input as ...
TFeld's user avatar
  • 19.8k
12 votes

Delannoy numbers

Jelly, 8 bytes Żc@Ɱ,PṚḄ Try it online! Because I couldn't tolerate Jelly being tied with APL. Again uses the formula $$D(m,n) = \sum_{k=0}^{\min(m,n)} \binom{m}{k} ...
Bubbler's user avatar
  • 76.7k
12 votes

Who Is Kevin Bacon?

BQN*, 53 45 bytesSBCS {1+⊑⍒+˝+´(∨∨∨˝∘×⎉1‿∞)⍟n˜∨⟜⍉∨˝𝕩≡⌜1+⋈⌜˜n←↕⌈´∾𝕩} Run online! Theory: Let \$k\$ be the maximum node id. Then the node IDs are \$\{1, 2, ..., k\}...
ovs's user avatar
  • 59.5k
11 votes
Accepted

Can Mario go to the end of this map

Slip, 38 27 25 bytes S>(`=<<`P{1,5}>`P>`P*)+#E Requires input to be padded to a rectangle such that there are spaces in every cell Mario needs to ...
Martin Ender's user avatar
11 votes

Island Golf #1: Circumnavigation

(But go upvote Notatree's solution, it's better!) Mathematica, 168 bytes ...
Greg Martin's user avatar
  • 15.7k
11 votes

What is the fastest safe way down a mountain?

JavaScript (ES6),  223 ... 205  199 bytes ...
Arnauld's user avatar
  • 193k
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....
Bubbler's user avatar
  • 76.7k
11 votes

Constructing an evil maze against random exploration

Tridents, score 21,947,177 21,951,598 ...
Neil's user avatar
  • 171k
10 votes

Island Golf #1: Circumnavigation

Python 3, 779 bytes (indenting with tabs) This is the whole program. It reads input from stdin and prints it to stdout. Stdin must end with EOF. Example run with the big input: https://ideone.com/...
Lera's user avatar
  • 101
10 votes

Is the room lit up?

Vyxal, 29 27 25 23 bytes 2(⌈ƛƛ:×c[¶1V];Ṅ;∩vṅ)∑¶↔ Split on wall, check if any spilt contain light, replace it with 1, transpose, do it again, check sum. outputs ...
okie's user avatar
  • 1,807
9 votes

Can Mario go to the end of this map

Java 234 230 221 216 208 207 205 179 Bytes Look, I beat C and python? I have acheived true transcendence among mortals! All jokes aside, this was a fun challenge. The following function takes input ...
Rohan Jhunjhunwala's user avatar
9 votes
Accepted

Traveling Pumpkin Problem

Jelly, 30 29 27 25 bytes _AṢæ.. 0,0ṭṚç2\+\<S Œ!ç€Ṁ Try it online! Apparently Jelly's dot product just ignores a list size mismatch and doesn't multiply the ...
PurkkaKoodari's user avatar
9 votes

Constructing an evil maze against random exploration

Two sides of mazes, score 21987725 ...
isaacg's user avatar
  • 42k
9 votes

Road golf through the mountains

05AB1E, 63 54 52 bytes Quite slow, but after some optimisation, this can now run some testcases! 2Føðδ.ø}©˜„ CSδQƶø0δK<®øg‰`Uæé.ΔX«Dδ-nO3‹DvDδ*O}ßĀ}g Try it ...
ovs's user avatar
  • 59.5k
8 votes
Accepted

Find the longest path, avoiding obstacles in a 2D plane

Python 3, 2619 bytes (90 LOC), ~6 seconds (20x20)   ...
Tersosauros's user avatar
8 votes
Accepted

Life is a Maze: We take the wrong Path before we learnt to walk

Retina, 338 281 275 273 261 bytes ...
TwiNight's user avatar
  • 4,800

Only top scored, non community-wiki answers of a minimum length are eligible