Questions tagged [puzzle-solver]

Use this tag if your challenge is about writing programs that solve puzzles such as Sudoku, Rubik's Cube, Crossword puzzles, etc.

Filter by
Sorted by
Tagged with
8 votes
2 answers
490 views

Evening Commute Solver

I recently moved to an apartment overlooking the inner ring-road of town, and every day, a beautiful scene unfolds. The traffic lights are apparently so confusing (mostly because the Dutch are used to ...
16 votes
2 answers
565 views

Taxicab in San Francisco

You are a taxicab driver in San Francisco. As is typical of taxicab drivers, you are navigating a grid where the only valid directions you can move are the left, right, up, and down. However, San ...
13 votes
3 answers
414 views

Minimal cost path in wall-breaking maze

Inspired by this Puzzling challenge. Challenge Given a 2D rectangular grid where each cell is either an empty space or a wall, find the path (or one of the paths) from the top left cell to the bottom ...
19 votes
2 answers
915 views

Solve an 0h n0 board

0h n0 is a very simple and enjoyable game, a bit like Sudoku or minesweeper. Game rules (I recommend using the tutorial in the game if you can, it is very simple and useful) The puzzle starts with ...
12 votes
2 answers
669 views

Interstellar Cabbages, Wolves, and Sheep

The Cabbage, Wolf, Goat riddle with a twist! Backstory: There’s an intergalactic river than needs to be crossed! Being a space-ferryman you’ve offered some aliens on your small space ferry that can ...
14 votes
2 answers
526 views

Interactive Maze Solver

Bob got kidnapped and is stuck in a maze. Your job is to help him find a way out. But since it is a very dark and scary maze, he can't see anything. He can only feel walls when he runs in to it, and ...
13 votes
2 answers
431 views

Solve a meta-knowledge puzzle

Alice and Bob are perfect logicians trapped on an island with a puzzle generator. Although they can instantly solve the Riemann hypothesis and P=NP just by thinking about it, rather than doing ...
14 votes
5 answers
3k views

Sudoku as a SAT problem

Background An interesting way to solve a Sudoku puzzle is to represent it as a Boolean satisfiability problem, and then feed it to a SAT solver. A Boolean Satisfiability Problem (abbreviated as SAT ...
16 votes
2 answers
5k views

Solve the (Rubiks) Pocket Cube

Your task .. is to do what Brian Fantana apparently couldn't do, and solve the 2x2x2 Rubik's Cube. The Layout ...
26 votes
2 answers
2k views

Nonogram line brute-force solving

Background Nonogram, also known as Picross or Griddlers, is a puzzle where the objective is to determine if each cell on the 2D grid should be colored or left blank, using the numbers of consecutive ...
16 votes
6 answers
909 views

"Signpost" puzzle from Tatham's collection

Simplified version of "Signpost" puzzle from Simon Tatham's Portable Puzzle Collection. How the puzzle is created We pick up randomly positive integer N ...
9 votes
4 answers
839 views

Let's go on a hyperjumping trip!

The idea is based on this interactive game. Given a set of eight decimal digits which are not necessarily distinct, your task is to find a hyperjump trip with the specified length. But what is a ...
36 votes
12 answers
18k views

The fastest Sudoku solver

Winner found It seems as if we have a winner! Unless anyone plans on contesting the world's current fastest Sudoku solver, user 53x15 wins with the staggeringly fast solver Tdoku. For anyone still ...
13 votes
3 answers
769 views

Write a FAST word equation solver

This question is similar to Write a word equation solver by David Frank but different in three important ways: (1) David asked for just the first solution found, and I am asking for all the solutions. ...
25 votes
14 answers
1k views

1D monochrome Link-a-Pix solvability

Background Link-a-Pix is a puzzle on a rectangular grid, where the objective is to reveal the hidden pixel art by the following rules: Connect two cells with number N with a line spanning N cells, so ...
17 votes
18 answers
1k views

Play Caesar's Cipher with Letters only

Description The Caesar cipher is a cipher, where every letter in the alphabet will be rotated by a secret number. If the rotation is \$7\$, then a -> ...
15 votes
10 answers
1k views

Count Futoshiki row solutions

Futoshiki is a logic puzzle where an \$n×n\$ Latin square must be completed based on given numbers and inequalities between adjacent cells. Each row and column must contain exactly one of each number ...
20 votes
2 answers
990 views

Can you connect the dots?

This challenge is based off of Flow Free. An online version can be found here: http://www.moh97.us/ You will be given a puzzle, and you must return 1 if the ...
12 votes
2 answers
760 views

Solving an easy Sudoku in increasing digit order

Introduction: I'm old-fashioned and still read a physical newspaper in the morning while eating my breakfast. Although I don't like Sudoku that much, I do solve the Light-complexity ones, which are ...
1 vote
0 answers
2k views

Solve the Greek Computer Puzzle Toy [closed]

Solve the Greek Computer Puzzle Toy There is a small toy of a series of stacked dials -- loosely inspired by the Antikythera Device. The puzzle, made by Project Genius, has a series of dials that must ...
17 votes
2 answers
948 views

We love our weird puzzles, us Brits

In a few British newspapers there is a game known as Hidato. It is somewhat similar to Sudoku, albeit instead of having 1-9 in a line and block, it's about placing numbers such that they connect in ...
11 votes
2 answers
713 views

Solve an Inglenook Sidings Puzzle

Solve an Inglenook Sidings Puzzle Background The Inglenook Sidings Puzzle is a shunting/switching yard puzzle by Alan Wright for model railroading. The rules for the puzzle are as follows: (Source) ...
5 votes
3 answers
233 views

Cubax Folding Game

Your task is to solve a new puzzle called Cubax. This toy is actually a Chinese puzzle whose expected “final” state is a simple cube. During the festivities, Cubax unfolded, because it cannot move ...
17 votes
3 answers
1k views

Solve Rubik's Clock

Rubik's Clock is a round(ish) puzzle with two flat sides. On each side, front and back, there are 9 clock faces, arranged on a 3x3 grid. In addition, there are 4 pegs (switches) in between the clock ...
23 votes
6 answers
3k views

Play the Fruit Box Game

Play the Fruit Box Game Intro Fruit Box is a game consisting of a 10x17 grid of numbers, each between 1 and 9, where the goal is to clear as many numbers as possible in a two-minute time window. In ...
9 votes
6 answers
339 views

AoCG2021 Day 25: Stitching maps together

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2020 Day 20, Part 1. (This day is a dreaded one for many of you, I know :P) Obligatory final "but you'...
19 votes
3 answers
2k views

Crossing a river with weird animals

Background One kind of river-crossing problems involves two kinds of animals. One such problem reads like this: (all wordings, including animal species, are arbitrary) A farmer has to cross a river ...
15 votes
2 answers
606 views

Is this Flow Free puzzle trivial?

Background Flow Free is a series of puzzle games whose objective is to connect all the same-colored pairs of dots on the grid. In this challenge, we consider the original game on a rectangular grid (...
33 votes
8 answers
6k views

Cut the gold chain

A traveler needs to stay for n days in a hotel outside town. He is out of cash and his credit card is expired. But he has a gold chain with n links. The rule in this hotel is that residents should ...
11 votes
2 answers
2k views

Solve a Rubik's Cube

Your challenge is to write a program to solve a 3x3x3 Rubik's Cube. This challenge is based on this one from 2013, rewritten to adhere to current community standards, and reposted with the original ...
14 votes
3 answers
309 views

Counting uniquely solvable polylinks

Related: Counting polystrips Background Link-a-Pix is a puzzle on a rectangular grid, where the objective is to reveal the hidden pixel art by the following rules: Connect two cells with number N ...
28 votes
4 answers
3k views

Implement a Non-Guessing Sudoku Solver

Implement the shortest Sudoku solver. Sudoku Puzzle: ...
12 votes
2 answers
581 views

Tatamibari solver

Background Tatamibari is a logic puzzle designed by Nikoli. A Tatamibari puzzle is played on a rectangular grid with three different kinds of symbols in it: +, <...
15 votes
6 answers
2k views

Solve 4x4 Mastermind in exactly 5 steps

Background Mastermind is a game of code-breaking for two players. One of the players is codemaker (Alice) and the other is codebreaker (Bob). 4x4 means that the player should guess the length-4 ...
14 votes
2 answers
558 views

Group these cells!

This challenge is based on the game Layerz. Given, on stdin or as a function argument, a 2D rectangular array of cells where each cell contains either a blank (you may choose to use 0s instead of ...
17 votes
8 answers
676 views

Recover boolean cells from windowed sums

Background In Minesweeper, you will often encounter a horizontal or vertical wall of one's and two's (not yet revealed cells are marked as ?): ...
11 votes
0 answers
272 views

Cover positions with snakes of same 'colour'

Imagine a grid where the origin square \$(0,0)\$ is at the top left of the screen, and positive \$x\$ is rightwards whereas positive \$y\$ is downwards. Coloured squares are at various positions on ...
9 votes
2 answers
861 views

Tents and Trees feasibility

Sequel to Verify Tents and Trees solution. Background Tents and Trees (try here) is a puzzle played on a square (or rectangular) grid, where the objective is to place tents horizontally or vertically ...
7 votes
3 answers
3k views

Lights Out - Find the solution

(This code golf task is related to Code-Golf: Lights Off!. The same puzzle is used, but the task is different.) Introduction "Lights Out" is a puzzle in which you should switch off all ...
14 votes
3 answers
483 views

Help Beth escape the desert

While similar to the other water-carrying puzzle, the unique aspects of this challenge make it entirely different. Beth is located at an oasis in the middle of a desert. There is plenty of water in ...
40 votes
5 answers
8k views

Solve the eight queens problem at compile-time [closed]

Can you solve the eight queens puzzle at compile-time? Pick any suitable output format. I'm particularly interested in a C++ template metaprogramming solution, but you can use languages that have ...
25 votes
13 answers
6k views

Implement a Brute Force Sudoku Solver

Implement the shortest Sudoku solver using guessing. Since I have received a few request I have added this as an alternative question for those wishing to implement a brute force sudoku solver. ...
10 votes
3 answers
6k views

Build a Killer Sudoku Solver

You thought regular sudoku was hard, now try Killer Sudoku! In the game of Killer Sudoku, you aren't given any numbers at all. Instead, you're given regions that are said to add up to a certain ...
6 votes
0 answers
319 views

Minimum cost of solving the Eni-Puzzle

You're tasked with writing an algorithm to efficiently estimate cost of solving an Eni-Puzzle from a scrambled state as follows: You're given m lists of containing n elements each(representing the ...
6 votes
4 answers
15k views

Solve the Magic Hexagon [closed]

A magic hexagon is a hexagon where every row and every diagonal add up to the same value. In this case the value is 38. Each number from 1 to 19 must be used exactly once. This image shows a solution ...
17 votes
10 answers
2k views

Write a word equation solver [duplicate]

Introduction Consider the following example: CODE + GOLF —————— GREAT This is an equation where each letter represents a decimal digit and the words ...
5 votes
4 answers
773 views

100 Prisoners and a light bulb

100 Prisoners and a light bulb You may have seen this puzzle over on the puzzles exchange or perhaps heard it somewhere else. If you are unfamiliar with this puzzle check out: 100 Prisoners and a ...
34 votes
17 answers
5k views

Create a Flood Paint AI

In the game of Flood Paint, the goal of the game is to get the entire board to be the same colour in as few turns as possible. The game starts with a board that looks something like this: ...
26 votes
3 answers
22k views

Solve the 15 Puzzle (the tile-sliding puzzle)

The 15 Puzzle is a famous puzzle involving sliding 15 tiles around on a 4x4 grid. Starting from a random configuration, the goal is to arrange the tiles in the correct order. Here is an example of a ...
39 votes
3 answers
24k views

Solve Rubik's cube

Write the shortest program that solves Rubik's cube (3*3*3) within a reasonable amount of time and moves (say, max. 5 seconds on your machine and less than 1000 moves). The input is in the format: <...