From dab9d1d2ae8309af3538f80106f80820c8805a8f Mon Sep 17 00:00:00 2001 From: Carleslc Date: Mon, 14 Feb 2022 16:25:34 +0100 Subject: [PATCH] Improve puzzle docs --- Layton/Curious Village/128-curious-lock.pro | 24 ++++++++++++++------- Layton/Curious Village/128-curious-lock.py | 24 ++++++++++++++------- Layton/Diabolical Box/145-pearls.py | 13 +++++++++++ Layton/Diabolical Box/148-eight-cards.py | 8 ++++++- Prolog/farmer.pro | 4 ++-- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/Layton/Curious Village/128-curious-lock.pro b/Layton/Curious Village/128-curious-lock.pro index e1df00f..b9f5c06 100644 --- a/Layton/Curious Village/128-curious-lock.pro +++ b/Layton/Curious Village/128-curious-lock.pro @@ -1,13 +1,21 @@ % Professor Layton: Curious Village (Puzzle 128) +% https://layton.fandom.com/wiki/Puzzle:Number_Lock -% Solve the following lock: -% -% A E -% B D F -% C G -% -% Where A * B * C = E * F * G = B * D * F -% With different digits from 1 to 9 +/** +The door in front of you has an odd lock mounted on the front. +The only way to unlock this strange contraption is to place small tiles labeled from one to nine in its slots. +The lock will open when the numbers on the lock equal the same number when multiplied vertically and horizontally. + +There are nine tiles, but the lock only has seven slots, so you won't need two tiles. + +Can you open the lock? + + A E + B D F + C G + +A * B * C = E * F * G = B * D * F +*/ :- use_module(library(clpfd)). diff --git a/Layton/Curious Village/128-curious-lock.py b/Layton/Curious Village/128-curious-lock.py index bc4a192..ae6266c 100644 --- a/Layton/Curious Village/128-curious-lock.py +++ b/Layton/Curious Village/128-curious-lock.py @@ -2,15 +2,23 @@ # -*- coding: utf-8 -*- # Professor Layton: Curious Village (Puzzle 128) +# https://layton.fandom.com/wiki/Puzzle:Number_Lock -# Solve the following lock: -# -# A E -# B D F -# C G -# -# Where A * B * C = E * F * G = B * D * F -# With different digits from 1 to 9 +""" +The door in front of you has an odd lock mounted on the front. +The only way to unlock this strange contraption is to place small tiles labeled from one to nine in its slots. +The lock will open when the numbers on the lock equal the same number when multiplied vertically and horizontally. + +There are nine tiles, but the lock only has seven slots, so you won't need two tiles. + +Can you open the lock? + + A E + B D F + C G + +A * B * C = E * F * G = B * D * F +""" from itertools import permutations diff --git a/Layton/Diabolical Box/145-pearls.py b/Layton/Diabolical Box/145-pearls.py index 1f046de..8b7708e 100644 --- a/Layton/Diabolical Box/145-pearls.py +++ b/Layton/Diabolical Box/145-pearls.py @@ -2,6 +2,19 @@ # -*- coding: utf-8 -*- # Professor Layton: Diabolical Box (Puzzle 145) +# https://layton.fandom.com/wiki/Puzzle:500_Pearls + +""" +A wizard sets a traveller a strange task. + +"There are 500 pearls in that cave. +I want you to go and bring a certain number of pearls to me. +This number allows you to divide the pearls into groups of 2, 3, 4, 5, 6 or 7 and always have one pearl left over. +Bring me this number of pearls and you can keep them all for yourself!" + +The traveller tries his best, but the number of pearls he bring back doesn't leave one pearl over when divided into groups of 4. +How many pearls did he bring to the wizard? +""" import argparse diff --git a/Layton/Diabolical Box/148-eight-cards.py b/Layton/Diabolical Box/148-eight-cards.py index da2d378..13505d0 100644 --- a/Layton/Diabolical Box/148-eight-cards.py +++ b/Layton/Diabolical Box/148-eight-cards.py @@ -2,8 +2,14 @@ # -*- coding: utf-8 -*- # Professor Layton: Diabolical Box (Puzzle 148) +# https://layton.fandom.com/wiki/Puzzle:Eight_Cards -# What are the valid products including all digits from 1 to 8 in the form ABC x D = EFGH ? +""" +These cards, numbered 1 to 8, can be used to make two multiplication equations. +One is given here (453 x 6 = 2718), but can you work out the second one? + +What are the valid products including all digits from 1 to 8 in the form ABC x D = EFGH ? +""" from itertools import permutations diff --git a/Prolog/farmer.pro b/Prolog/farmer.pro index 15930fe..a06b0d5 100644 --- a/Prolog/farmer.pro +++ b/Prolog/farmer.pro @@ -1,9 +1,9 @@ +% https://www.metalevel.at/prolog/optimization +% % A chicken farmer also has some cows for a total of 30 animals, % and the animals have 74 legs in all. % % How many chickens does the farmer have? -% -% https://www.metalevel.at/prolog/optimization :- use_module(library(clpfd)).