Skip to content

Commit 76c2110

Browse files
ErikSchierboomiHiDMatthijsBlom
authored
zebra-puzzle: convert description to introduction and instructions (#2419)
* zebra-puzzle: convert description to introduction and instructions * Update exercises/zebra-puzzle/introduction.md Co-authored-by: Jeremy Walker <jez.walker@gmail.com> * Update exercises/zebra-puzzle/introduction.md Co-authored-by: Matthijs <19817960+MatthijsBlom@users.noreply.github.com> * Update exercises/zebra-puzzle/introduction.md Co-authored-by: Jeremy Walker <jez.walker@gmail.com> * Update exercises/zebra-puzzle/instructions.md Co-authored-by: Matthijs <19817960+MatthijsBlom@users.noreply.github.com> * Small tweak --------- Co-authored-by: Jeremy Walker <jez.walker@gmail.com> Co-authored-by: Matthijs <19817960+MatthijsBlom@users.noreply.github.com>
1 parent 5cf5539 commit 76c2110

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

exercises/zebra-puzzle/description.md renamed to exercises/zebra-puzzle/instructions.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# Description
1+
# Instructions
22

3-
Solve the zebra puzzle.
3+
Your task is to solve the Zebra Puzzle to find the answer to these two questions:
4+
5+
- Which of the residents drinks water?
6+
- Who owns the zebra?
7+
8+
## Puzzle
9+
10+
The following 15 statements are all known to be true:
411

512
1. There are five houses.
613
2. The Englishman lives in the red house.
@@ -18,7 +25,8 @@ Solve the zebra puzzle.
1825
14. The Japanese smokes Parliaments.
1926
15. The Norwegian lives next to the blue house.
2027

21-
Each of the five houses is painted a different color, and their inhabitants are of different national extractions, own different pets, drink different beverages and smoke different brands of cigarettes.
28+
Additionally, each of the five houses is painted a different color, and their inhabitants are of different national extractions, own different pets, drink different beverages and smoke different brands of cigarettes.
2229

23-
Which of the residents drinks water?
24-
Who owns the zebra?
30+
~~~~exercism/note
31+
There are 24 billion (5!⁵ = 24,883,200,000) possible solutions, so try ruling out as many solutions as possible.
32+
~~~~
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Introduction
2+
3+
The Zebra Puzzle is a famous logic puzzle in which there are five houses, each painted a different color.
4+
The houses have different inhabitants, who have different nationalities, own different pets, drink different beverages and smoke different brands of cigarettes.
5+
6+
To help you solve the puzzle, you're given 15 statements describing the solution.
7+
However, only by combining the information in _all_ statements will you be able to find the solution to the puzzle.
8+
9+
~~~~exercism/note
10+
The Zebra Puzzle is a [Constraint satisfaction problem (CSP)][constraint-satisfaction-problem].
11+
In such a problem, you have a set of possible values and a set of constraints that limit which values are valid.
12+
Another well-known CSP is Sudoku.
13+
[constraint-satisfaction-problem]: https://en.wikipedia.org/wiki/Constraint_satisfaction_problem
14+
~~~~

0 commit comments

Comments
 (0)