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
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 ...
alephalpha's user avatar
  • 46.5k
16 votes
6 answers
896 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 ...
lesobrod's user avatar
  • 3,239
9 votes
4 answers
766 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 ...
polfosol ఠ_ఠ's user avatar
12 votes
2 answers
663 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 ...
joyoforigami's user avatar
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 ...
Parcly Taxel's user avatar
  • 3,707
12 votes
2 answers
754 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 ...
Kevin Cruijssen's user avatar
1 vote
0 answers
1k 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 ...
rubbernilly's user avatar
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 -> ...
math scat's user avatar
  • 8,463
5 votes
3 answers
229 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 ...
DialFrost's user avatar
  • 5,055
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 ...
Jitse's user avatar
  • 6,876
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 ...
Theo's user avatar
  • 509
9 votes
6 answers
338 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'...
lyxal's user avatar
  • 32.5k
11 votes
2 answers
620 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) ...
bigyihsuan's user avatar
  • 8,548
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 ...
Bubbler's user avatar
  • 73.8k
14 votes
2 answers
590 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 (...
Bubbler's user avatar
  • 73.8k
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 ...
Bubbler's user avatar
  • 73.8k
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 ...
Bubbler's user avatar
  • 73.8k
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 ...
Bubbler's user avatar
  • 73.8k
11 votes
2 answers
348 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 ...
Bubbler's user avatar
  • 73.8k
10 votes
0 answers
262 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 ...
lightlyheld's user avatar
17 votes
8 answers
672 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 ?): ...
Bubbler's user avatar
  • 73.8k
9 votes
2 answers
849 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 ...
Bubbler's user avatar
  • 73.8k
13 votes
2 answers
430 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 ...
soktinpk's user avatar
  • 4,472
36 votes
12 answers
17k 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 ...
maxb's user avatar
  • 6,837
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 ...
polfosol ఠ_ఠ's user avatar
14 votes
2 answers
512 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 ...
Maltysen's user avatar
  • 25.7k
6 votes
0 answers
317 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 ...
Conor James Thomas Warford Hen's user avatar
12 votes
2 answers
548 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: +, <...
Bubbler's user avatar
  • 73.8k
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 ...
Bubbler's user avatar
  • 73.8k
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 ...
MD XF's user avatar
  • 13.8k
8 votes
9 answers
510 views

Make sets disjoint without emptying them

Suppose you have a set of sets of integers. It's possible that some of the sets will overlap (i.e. sharing elements). You could get rid of the overlaps by deleting elements from the sets, but then ...
fred russell's user avatar
39 votes
3 answers
1k views

Solve this Alcazar for me

Recently I've been playing a game called Alcazar. It is a board puzzle game where your goal is to enter from one door, pass through all squares, and exit through another door. The only rules are: ...
Phelype Oleinik's user avatar
17 votes
2 answers
1k views

Solve a Matchstick puzzle

On puzzling SE there are what are called "matchstick problems" in which math is written in match sticks and you are allowed to move a certain number of them to get a certain property. In this ...
Wheat Wizard's user avatar
  • 96.5k
14 votes
5 answers
549 views

Lights out, 7-segment version

Given a 7-segment display with some segments switched on and some off, find a sequence of digits (0-9), such that after toggling the corresponding segments for each digit, all segments are switched ...
kyrill's user avatar
  • 615
14 votes
3 answers
481 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 ...
romaninsh's user avatar
  • 993
3 votes
1 answer
1k views

Witness My Challenge (Tetris Puzzle)

Introduction In the game The Witness (possible spoilers ahead) there is a group of puzzles that involve drawing a Tetris piece with your line while making sure that the symbol for the Tetris piece ...
Bobas_Pett's user avatar
  • 1,025
14 votes
2 answers
557 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 ...
SuperJedi224's user avatar
  • 11.9k
14 votes
1 answer
528 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 ...
0																												''s user avatar
  • 3,741
5 votes
4 answers
767 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 ...
jacksonecac's user avatar
  • 2,624
8 votes
5 answers
399 views

Retrieve all possible marks that can be placed in a Sudoku puzzle [closed]

Given a Sudoku puzzle, find all possible marks that can be filled into each empty cell. Test case Input: ...
driima's user avatar
  • 461
5 votes
4 answers
273 views

Counterfeit Coins on a Pointer Scale

You sell gold coins. Each gold coin you sell is supposed to be 1 ounce. However, you find out that one of your coin suppliers is cheating you. By alloying the gold material with something else, their ...
TheHans255's user avatar
24 votes
1 answer
3k views

Solve Grid-Tangram

The Tangram is a dissection puzzle made from seven shapes: Five differently sized triangles, a parallelogram and a square. Given a shape, the goal is recreating the shape using all the pieces and ...
flawr's user avatar
  • 43.7k
22 votes
6 answers
3k views

Can you beat the British Intelligence? (Nonogram Solver)

It is time to embark on a perilous quest to defeat the British Intelligence. The aim of this challenge is to write the shortest code that will solve a Nonogram. What is a Nonogram? The rules are ...
gowrath's user avatar
  • 905
35 votes
6 answers
2k views

Solve the chromatic puzzle

Over at our friends at Puzzling.SE, the following puzzle was posted: Is this chromatic puzzle always solvable? by Edgar G. You can play it here. Puzzle explanation Given a ...
Sanchises's user avatar
  • 9,446
35 votes
7 answers
2k views

A Tiny Explorer

You are an explorer, mapping an unknown world. Your ship is carried on the wind. Where it goes, who knows? Each day, in your spyglass, you see features to the north, south, east and west. You always ...
user52676's user avatar
  • 453
12 votes
1 answer
1k views

Easy as ABC Solver

Easy As ABC, also known as "End View", is a puzzle where you are given an empty grid with letters around it; you must partially fill in the grid so that exactly one of each letter is in ...
Deusovi's user avatar
  • 1,520
18 votes
1 answer
832 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 ...
J Atkin's user avatar
  • 5,070
22 votes
2 answers
429 views

A Peak Experience: Quickly Visit All the Peaks

I am standing at point (0,0) in a H x W map where the altitude is represented by digits, for ...
cozyconemotel's user avatar
13 votes
4 answers
682 views

Build a Nonographic Magnitude Optimizer™

A nonogram is a Japanese puzzle game in which the goal is to draw a black-and-white picture according to a list of contiguous regions, like so: Define the nonographic magnitude of a row or column to ...
Joe Z.'s user avatar
  • 34.7k
10 votes
2 answers
386 views

Crack the safe!

Inspired by https://puzzling.stackexchange.com/questions/24334/to-catch-a-thief You are given an n by n (...
ghosts_in_the_code's user avatar