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 ...
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 ...
user avatar
  • 651
18 votes

Solve Rubik's Clock

05AB1E, 203 202 193 192 bytes ...
user avatar
17 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 ...
user avatar
  • 14.6k
16 votes

Create a Flood Paint AI

C# - 2,098,382 steps I try many things, most of them fail and just didn't work at all, until recently. I got something interesting enough to post an answer. There is certainly ways to improve this ...
user avatar
  • 2,377
16 votes
Accepted

Cut the gold chain

05AB1E, 23 11 8 bytes ΔÍN-;иg= Try it online! Uses 0-based indexing. Explanation: ...
user avatar
  • 15.3k
14 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$ # ...
user avatar
  • 314
13 votes

Solve the chromatic puzzle

Octave, 334 313 bytes Since the challenge may seem a bit daunting, I present my own solution. I did not formally prove that this method works (I guess that will come down to proving that the ...
user avatar
  • 9,336
11 votes

Write a word equation solver

Python - 48 characters ...
user avatar
11 votes
Accepted

Solve the (Rubiks) Pocket Cube

Python 2.7: 544 bytes -50% = 272 bytes** ...
user avatar
  • 21.8k
10 votes

Create a Flood Paint AI

Python – 10,800,000 steps As a last-place reference solution, consider this sequence: print "123456" * 18 Cycling through all the colours ...
user avatar
  • 33.8k
10 votes
Accepted

Solve the BattleBlock Theater Puzzle

Python 2, 115 bytes n=input() for F in range(4): t=[F];b=0;exec"x=(-n[b]-sum(t[-2:]))%4;t+=x,;b+=1;"*len(n) if x<1:print t[:-1];break This is the ...
user avatar
  • 61k
10 votes

Stringing a Pearl Necklace

Python - 1669 Still pretty long, but fast enough to run the last example in under a second on my computer. It's probably possible to make shorter at the cost of speed, but for now it is pretty much ...
user avatar
  • 6,554
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 ...
user avatar
  • 168k
9 votes
Accepted

Is the word typeable with keys adjacent to each other?

Pyth, 66 ?"Yes".Am>2sm^-.uk2Cm.Dx"qwertyuiopasdfghjkl*zxcvbnm"b9.5dC,ztz"No Try it here. I was surprised to learn Pyth doesn't have a ...
user avatar
  • 38.7k
9 votes
Accepted

A Tiny Explorer

MATL, 68 59 58 bytes '?'7XJQtX"'s'jh5e"@2#1)t35>)-1l8t_4$h9M)b'nsew'=8M*sJ+XJ+( Try it online! Explanation The map is kept in the bottom of the stack ...
user avatar
  • 99.5k
9 votes

Can you beat the British Intelligence? (Nonogram Solver)

Haskell, 242 230 201 199 177 163 160 149 131 bytes ...
user avatar
  • 1,485
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' ...
user avatar
  • 19.7k
8 votes
Accepted

Build a pair of spies that will throw stones into a river

C#, M = 2535 This implements* the system which I described mathematically on the thread which provoked this contest. I claim the 300 rep bonus. The program self-tests if you run it either without ...
user avatar
  • 42.8k
8 votes

Create a Flood Paint AI

Java - 2,480,714 steps I made a little mistake before (I put one crucial sentence before a loop instead of in the loop: ...
user avatar
  • 1,157
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: ...
user avatar
  • 38.7k
8 votes

Build a MU puzzle solver

SWI Prolog, 183 characters ...
user avatar
  • 659
8 votes
Accepted

A Good Time to Refuse

Python 2, 305 This is the golfed version. It is practically unusable for n > 3, as the time (and space) complexity is like 3n2... actually that may be way too low for the time. Anyway, the function ...
user avatar
  • 30.9k
8 votes
Accepted

Stringing a Pearl Necklace

C, 590 640 760 880 963 1018 Brute force is quite fast for this. The 12x12 test runs under 10ms. Knowing that could opt for some language more appropriate for golfing. I don't assume the board is ...
user avatar
  • 3,732
8 votes
Accepted

Build a Nonographic Magnitude Optimizer™

Python 2 & PuLP — 2,644,688 squares (optimally minimized); 10,753,553 squares (optimally maximized) Minimally golfed to 1152 bytes ...
user avatar
  • 4,077
8 votes

Help Beth escape the desert

JavaScript (ES6), 25 bytes ...
user avatar
  • 145k
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 ...
user avatar
  • 15.2k
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 ...
user avatar
  • 168k
7 votes

Implement a Brute Force Sudoku Solver

Perl, 120 bytes Oh, I remember golfing that back in 2008... And it in fact stopped working in perl 5.12 since implicit setting of @_ by split was removed then. So only try this on a sufficiently old ...
user avatar
  • 14.6k
7 votes

Write a FAST word equation solver

Python3, 0.03 seconds: ...
user avatar
  • 3,046

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