Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,21 @@
const
Baker = 0; Cooper = 1; Fletcher = 2; Miller = 3; Smith = 4;
names: array of string = ('Baker', 'Cooper', 'Fletcher', 'Miller', 'Smith');
begin
var floors := arr(1..5);
repeat
if (floors[Baker] <> 5) and
(floors[Cooper] <> 1) and
(floors[Fletcher] not in [1, 5]) and
(floors[Miller] > floors[Cooper]) and
(abs(floors[Smith] - floors[Fletcher]) <> 1) and
(abs(floors[Fletcher] - floors[Cooper]) <> 1) then
begin
foreach var floor in floors index person do
println(names[person], 'lives on floor', floor);
exit
end;
until not NextPermutation(floors);
println('No solution found.');
end.