Skip to main content
34 votes

Solve Grid-Tangram

BBC BASIC, 570 514 490 bytes ASCII Download interpreter at http://www.bbcbasic.co.uk/bbcwin/download.html 435 bytes tokenised Full program displays an input from ...
Level River St's user avatar
21 votes

Nonogram line brute-force solving

Ruby, 85 bytes f=->l,n,s=n-l.sum-l.size+1{*a,b=l;b&&s>0?(a[0]?1+f[a,n-b-2,s-1]:(n.to_f/b).ceil-1):0} Try it online! Explanation The first step is ...
crashoz's user avatar
  • 751
18 votes
Accepted

Shortest 2-Player Game of Halma

The shortest game of halma is 49 moves 49 move solution Proof there is no 48-move solution Code used for this solution The code now supports pass Notice that the 47 move solution in the paper is ...
Ton Hospel's user avatar
  • 14.9k
18 votes

Solve Rubik's Clock

05AB1E, 203 202 193 192 bytes ...
Kevin Cruijssen's user avatar
16 votes
Accepted

Cut the gold chain

05AB1E, 23 11 8 bytes ΔÍN-;иg= Try it online! Uses 0-based indexing. Explanation: ...
Grimmy's user avatar
  • 15.8k
15 votes
Accepted

The fastest Sudoku solver

C++ - 0.201s official score Using Tdoku (code; design; benchmarks) gives these results: ~/tdoku$ lscpu | grep Model.name Model name: Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz ~/tdoku$ # ...
53x15's user avatar
  • 349
10 votes

1D monochrome Link-a-Pix solvability

JavaScript (ES6), 41 bytes Returns false for valid or true for invalid. a=>a.some(p=(x,i)=>--p>0?x:a[i+x-1]^=p=x) Try it online! Commented ...
Arnauld's user avatar
  • 198k
9 votes

Cut the gold chain

Python 2, 75 bytes f=lambda n,i=0:n>=i<<i and f(n,i+1)or[min(n,2**j*i-i+j)for j in range(1,i)] Try it online! Explanation: Builds a sequence of 'binary' ...
TFeld's user avatar
  • 19.9k
9 votes

The fastest Sudoku solver

C - 0.045s unofficial score I got this time on my i7-9750H with 6 cores 12 threads @ 4Ghz. I'm aware that my cpu is faster than the i7-7700HQ so I think (hope) it would be closer to 0.080s if it were ...
Mirage's user avatar
  • 91
8 votes
Accepted

Solve the 15 Puzzle (the tile-sliding puzzle)

PyPy, 195 moves, ~12 seconds computation Computes optimal solutions using IDA* with a 'walking distance' heuristic augmented with linear conflicts. Here are the optimal solutions: ...
orlp's user avatar
  • 39.2k
8 votes

Help Beth escape the desert

JavaScript (ES6), 25 bytes ...
Neil's user avatar
  • 177k
8 votes

Cut the gold chain

R, 77 69 bytes -8 bytes thanks to Aaron Hayman pmin(n<-scan(),0:(k=sum((a=2:n)*2^a<=n))+cumsum((k+2)*2^(0:k))+1)[-n] Try it online! Let \$k\$ be the ...
Robin Ryder's user avatar
  • 15.6k
8 votes

The fastest Sudoku solver

Node.js, 8.231s 6.735s official score Takes the file name as argument. The input file may already contain the solutions in the format described in the challenge, in which case the program will ...
Arnauld's user avatar
  • 198k
7 votes

Solve a Matchstick puzzle

JavaScript (ES6), 297 286 279 267 bytes Takes input in currying syntax (s)(k), where s is an array of digit characters and k is the number of moves (integer). <...
Arnauld's user avatar
  • 198k
7 votes

Solve a Rubik's Cube

Cubically, 3 bytes rp▦ Try it online! You can use this to print a random cube. Explanation: ...
MD XF's user avatar
  • 13.9k
7 votes

Interactive Maze Solver

JavaScript (ES6),  180  174 bytes Uses prompt() to output the direction and retrieve the result. ...
Arnauld's user avatar
  • 198k
7 votes

1D monochrome Link-a-Pix solvability

Jelly, 15 bytes Ṁ1;Ṭ×Ʋ€ṚœṣF¥ƒ⁸Ẹ Try it online! A monadic link taking a list of integers and returning 0 for those that have a ...
Nick Kennedy's user avatar
  • 21.2k
6 votes

Write a FAST word equation solver

Python3, 0.03 seconds: ...
Ajax1234's user avatar
  • 7,711
6 votes
Accepted

Create a Flood Paint AI

Java - 1,985,078 steps https://github.com/smack42/ColorFill Another late entry. The result file containing the 1,985,078 steps can be found here. Some background info: I discovered this challenge ...
smack42's user avatar
  • 76
6 votes

1D monochrome Link-a-Pix solvability

J, 33 bytes 0(-.~-:2#_2-~/\I.@:<)1&(1+=j.<)#] Try it online! A large part is reused from Jonah's solution, but this solution adds an idea and a J-...
Bubbler's user avatar
  • 78.4k
6 votes

Crossing a river with weird animals

Wolfram Language (Mathematica), 97 bytes Saved 6 bytes thanks to @att. ...
alephalpha's user avatar
6 votes

AoCG2021 Day 25: Stitching maps together

Charcoal, 51 bytes F⁹«≔⟦⟧θWS⊞θκ⊞υ⁺E²⭆θ§μ±κE²§θ±κ»IΦ⁹⬤§υι⊙υ∧⁻ιξ∨№νλ№ν⮌λ Try it online! Link is to verbose version of code. Outputs the 0-indexed index of the of the ...
Neil's user avatar
  • 177k
6 votes

Play the Fruit Box Game

Python3, 659 bytes: ...
Ajax1234's user avatar
  • 7,711
6 votes
Accepted

Play the Fruit Box Game

C++ (gcc) Performs a brute force search. Its strategy is to greedily choose rectangles that yield the least amount of points. Although counter-intuitive, this strategy is seemingly effective. To give ...
dingledooper's user avatar
  • 22.9k
6 votes

Sudoku as a SAT problem

Python3, 427 bytes ...
Ajax1234's user avatar
  • 7,711
5 votes

Create a Flood Paint AI

C - 2,075,452 I know I'm extremely late to the party, but I saw this challenge and wanted to have a go. ...
user1502040's user avatar
  • 3,864
5 votes

Solve this Alcazar for me

Python 3, 809 728 723 714 693 688 684 663 657 641 639 627 610 571 569 bytes Edit: Saved 55 bytes thanks to @Felipe Nardi Batista Does not run the last test case in 60 seconds on TIO, but should work ...
Halvard Hummel's user avatar
5 votes

Solve this Alcazar for me

APL (Dyalog Classic), 319 bytes ...
ngn's user avatar
  • 15.3k
5 votes

Tatamibari solver

Python 2, 417 374 366 bytes Input is list of lines, ~ for non-clue. Outputs a single solution to stderr in the format ...
ovs's user avatar
  • 60.6k
5 votes

Tents and Trees feasibility

Python 3.8 (pre-release), 253 244 bytes ...
fireflame241's user avatar
  • 16.3k

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