Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,22 +0,0 @@
with Ada.Text_IO;
procedure Department_Numbers is
use Ada.Text_IO;
begin
Put_Line (" P S F");
for Police in 2 .. 6 loop
for Sanitation in 1 .. 7 loop
for Fire in 1 .. 7 loop
if
Police mod 2 = 0 and
Police + Sanitation + Fire = 12 and
Sanitation /= Police and
Sanitation /= Fire and
Police /= Fire
then
Put_Line (Police'Image & Sanitation'Image & Fire'Image);
end if;
end loop;
end loop;
end loop;
end Department_Numbers;

View file

@ -1,37 +0,0 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. DEPARTMENT-NUMBERS.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 BANNER PIC X(24) VALUE "POLICE SANITATION FIRE".
01 COMBINATION.
03 FILLER PIC X(5) VALUE SPACES.
03 POLICE PIC 9.
03 FILLER PIC X(11) VALUE SPACES.
03 SANITATION PIC 9.
03 FILLER PIC X(5) VALUE SPACES.
03 FIRE PIC 9.
01 TOTAL PIC 99.
PROCEDURE DIVISION.
BEGIN.
DISPLAY BANNER.
PERFORM POLICE-LOOP VARYING POLICE FROM 2 BY 2
UNTIL POLICE IS GREATER THAN 6.
STOP RUN.
POLICE-LOOP.
PERFORM SANITATION-LOOP VARYING SANITATION FROM 1 BY 1
UNTIL SANITATION IS GREATER THAN 7.
SANITATION-LOOP.
PERFORM FIRE-LOOP VARYING FIRE FROM 1 BY 1
UNTIL FIRE IS GREATER THAN 7.
FIRE-LOOP.
ADD POLICE, SANITATION, FIRE GIVING TOTAL.
IF POLICE IS NOT EQUAL TO SANITATION
AND POLICE IS NOT EQUAL TO FIRE
AND SANITATION IS NOT EQUAL TO FIRE
AND TOTAL IS EQUAL TO 12,
DISPLAY COMBINATION.

View file

@ -1,7 +1,7 @@
using Printf
function findsolution(rng=1:7)
rst = Matrix{Int}(0, 3)
rst = Matrix{Int}(undef, 0, 3)
for p in rng, f in rng, s in rng
if p != s != f != p && p + s + f == 12 && iseven(p)
rst = [rst; p s f]

View file

@ -20,5 +20,3 @@ let combos = (
$combos | filter { |it|
($it.police + $it.sanitation + $it.fire) == 12 and ($it.police mod 2) == 0
} | sort-by police sanitation fire
}