cbarrick / puzzles.pl

Logic puzzles in Prolog
1 stars 0 forks source link

Puzzles.pl

Solutions to puzzles in Prolog

kakuro.pl

Solves kakuros.

Kakuro or Kakkuro (Japanese: カックロ) is a kind of logic puzzle that is often referred to as a mathematical transliteration of the crossword.

[...]

The objective of the puzzle is to insert a digit from 1 to 9 inclusive into each white cell such that the sum of the numbers in each entry matches the clue associated with it and that no digit is duplicated in any entry.

— Wikipedia (http://en.wikipedia.org/wiki/Kakuro)

nonogram.pl

Solves nonograms.

Nonograms, also known as Hanjie or Griddlers, are picture logic puzzles in which cells in a grid must be colored or left blank according to numbers at the side of the grid to reveal a hidden picture.

[...]

Nonograms have no theoretical limits on size, and are not restricted to square layouts.

— Wikipedia (http://en.wikipedia.org/wiki/Nonogram)

sudoku.pl

Solves sudokus.

Sudoku (数独 sūdoku?, Digit-single) /suːˈdoʊkuː/, originally called Number Place, is a logic-based, combinatorial number-placement puzzle. The objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 sub-grids that compose the grid contains all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a unique solution.

— Wikipedia (http://en.wikipedia.org/wiki/Sudoku)

zebra.pl

Solves the zebra problem.

  1. There are five houses.
  2. The Englishman lives in the red house.
  3. The Spaniard owns the dog.
  4. Coffee is drunk in the green house.
  5. The Ukrainian drinks tea.
  6. The green house is immediately to the right of the ivory house.
  7. The Old Gold smoker owns snails.
  8. Kools are smoked in the yellow house.
  9. Milk is drunk in the middle house.
  10. The Norwegian lives in the first house.
  11. The man who smokes Chesterfields lives in the house next to the man with the fox.
  12. Kools are smoked in the house next to the house where the horse is kept.
  13. The Lucky Strike smoker drinks orange juice.
  14. The Japanese smokes Parliaments.
  15. The Norwegian lives next to the blue house.

Now, who drinks water? Who owns the zebra?

— Life International, December 17, 1962