- `bat --squeeze-blank`/`bat -s` will now squeeze consecutive empty lines, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
- `bat --squeeze-limit` to set the maximum number of empty consecutive when using `--squeeze-blank`, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
- `PrettyPrinter::squeeze_empty_lines` to support line squeezing for bat as a library, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
- Syntax highlighting for JavaScript files that start with `#!/usr/bin/env bun`#2913 (@sharunkumar)
comment: This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
[38;2;117;113;94m% A formulation of Einstein's Riddle (aka Zebra Puzzle) in Prolog (specifically, SWI-Prolog - see http://www.swi-prolog.org/) as appeared on Life International magazine 17/12/1962[0m
[38;2;117;113;94m% - Each house is represented by the predicate house/5[0m
[38;2;117;113;94m% - The five houses are modelled as a(n) (ordered) list of house(Color, Nationality, Pet, Beverage, Cigaret) in the variable Houses[0m
[38;2;117;113;94m% - The predicate solve/2 for solving the riddle is of the form solve(WaterDrinker, ZebraOwner) where WaterDrinker is the nationality of the person who drinks water and ZebraOwner the nationality of the person owning a zebra as a pet[0m
[38;2;117;113;94m% Expected solution: if the problem is modelled correctly by this program then the only solution set should be:[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242ml[0m[38;2;248;248;242me[0m[38;2;248;248;242mn[0m[38;2;248;248;242mg[0m[38;2;248;248;242mt[0m[38;2;248;248;242mh[0m[38;2;248;248;242m([0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255m5[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 1. There are five houses.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[38;2;190;132;255mred[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255menglish[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 2. The Englishman lives in the red house.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mspanish[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mdog[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 3. The Spaniard owns the dog.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[38;2;190;132;255mgreen[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mcoffee[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 4. Coffee is drunk in the green house.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mukrainian[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mtea[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 5. The Ukrainian drinks tea.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mn[0m[38;2;248;248;242me[0m[38;2;248;248;242mx[0m[38;2;248;248;242mt[0m[38;2;248;248;242mt[0m[38;2;248;248;242mo[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[38;2;190;132;255mivory[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[38;2;190;132;255mgreen[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 6. The green house is immediately to the right of the ivory house.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255msnail[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mold_gold[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 7. The Old Gold smoker owns snails.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[38;2;190;132;255myellow[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mkools[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 8. Kools are smoked in the yellow house.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mn[0m[38;2;248;248;242mt[0m[38;2;248;248;242mh[0m[38;2;248;248;242m1[0m[38;2;248;248;242m([0m[38;2;190;132;255m3[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mmilk[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 9. Milk is drunk in the middle house.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mn[0m[38;2;248;248;242mt[0m[38;2;248;248;242mh[0m[38;2;248;248;242m1[0m[38;2;248;248;242m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mnorwegian[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 10. The Norwegian lives in the first house.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242ma[0m[38;2;248;248;242md[0m[38;2;248;248;242mj[0m[38;2;248;248;242ma[0m[38;2;248;248;242mc[0m[38;2;248;248;242me[0m[38;2;248;248;242mn[0m[38;2;248;248;242mt[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mchesterfields[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mfox[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 11. The man who smokes Chesterfields lives in the house next to the man with the fox.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242ma[0m[38;2;248;248;242md[0m[38;2;248;248;242mj[0m[38;2;248;248;242ma[0m[38;2;248;248;242mc[0m[38;2;248;248;242me[0m[38;2;248;248;242mn[0m[38;2;248;248;242mt[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mkools[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mhorse[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 12. Kools are smoked in the house next to the house where the horse is kept.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255morange_juice[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mlucky_strike[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 13. The Lucky Strike smoker drinks orange juice.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mjapanese[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mparliaments[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 14. The Japanese smokes Parliaments.[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242ma[0m[38;2;248;248;242md[0m[38;2;248;248;242mj[0m[38;2;248;248;242ma[0m[38;2;248;248;242mc[0m[38;2;248;248;242me[0m[38;2;248;248;242mn[0m[38;2;248;248;242mt[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mnorwegian[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[38;2;190;132;255mblue[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% 15. The Norwegian lives next to the blue house[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mWaterDrinker[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mwater[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;117;113;94m% Who (WaterDrinker) drinks water?[0m
[38;2;248;248;242m[0m[38;2;248;248;242m[0m[38;2;248;248;242mm[0m[38;2;248;248;242me[0m[38;2;248;248;242mm[0m[38;2;248;248;242mb[0m[38;2;248;248;242me[0m[38;2;248;248;242mr[0m[38;2;248;248;242m([0m[38;2;248;248;242mh[0m[38;2;248;248;242mo[0m[38;2;248;248;242mu[0m[38;2;248;248;242ms[0m[38;2;248;248;242me[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mZebraOwner[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[38;2;190;132;255mzebra[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m[0m[3;38;2;253;151;31mHouses[0m[38;2;248;248;242m)[0m[38;2;249;38;114m.[0m[38;2;248;248;242m[0m[38;2;117;113;94m% Who (ZebraOwner) owns the zebra?[0m
% A formulation of Einstein's Riddle (aka Zebra Puzzle) in Prolog (specifically, SWI-Prolog - see http://www.swi-prolog.org/) as appeared on Life International magazine 17/12/1962
% - Each house is represented by the predicate house/5
% - The five houses are modelled as a(n) (ordered) list of house(Color, Nationality, Pet, Beverage, Cigaret) in the variable Houses
% - The predicate solve/2 for solving the riddle is of the form solve(WaterDrinker, ZebraOwner) where WaterDrinker is the nationality of the person who drinks water and ZebraOwner the nationality of the person owning a zebra as a pet
% Expected solution: if the problem is modelled correctly by this program then the only solution set should be:
% solve/2 - The main predicate for solving the puzzle
solve(WaterDrinker,ZebraOwner):-
length(Houses,5),% 1. There are five houses.
member(house(red,english,_,_,_),Houses),% 2. The Englishman lives in the red house.
member(house(_,spanish,dog,_,_),Houses),% 3. The Spaniard owns the dog.
member(house(green,_,_,coffee,_),Houses),% 4. Coffee is drunk in the green house.
member(house(_,ukrainian,_,tea,_),Houses),% 5. The Ukrainian drinks tea.
nextto(house(ivory,_,_,_,_),house(green,_,_,_,_),Houses),% 6. The green house is immediately to the right of the ivory house.
member(house(_,_,snail,_,old_gold),Houses),% 7. The Old Gold smoker owns snails.
member(house(yellow,_,_,_,kools),Houses),% 8. Kools are smoked in the yellow house.
nth1(3,Houses,house(_,_,_,milk,_)),% 9. Milk is drunk in the middle house.
nth1(1,Houses,house(_,norwegian,_,_,_)),% 10. The Norwegian lives in the first house.
adjacent(house(_,_,_,_,chesterfields),house(_,_,fox,_,_),Houses),% 11. The man who smokes Chesterfields lives in the house next to the man with the fox.
adjacent(house(_,_,_,_,kools),house(_,_,horse,_,_),Houses),% 12. Kools are smoked in the house next to the house where the horse is kept.
member(house(_,_,_,orange_juice,lucky_strike),Houses),% 13. The Lucky Strike smoker drinks orange juice.
member(house(_,japanese,_,_,parliaments),Houses),% 14. The Japanese smokes Parliaments.
adjacent(house(_,norwegian,_,_,_),house(blue,_,_,_,_),Houses),% 15. The Norwegian lives next to the blue house
member(house(_,WaterDrinker,_,water,_),Houses),% Who (WaterDrinker) drinks water?
member(house(_,ZebraOwner,zebra,_,_),Houses).% Who (ZebraOwner) owns the zebra?