Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
13
Task/Department-numbers/ANSI-BASIC/department-numbers.basic
Normal file
13
Task/Department-numbers/ANSI-BASIC/department-numbers.basic
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
100 REM Department numbars
|
||||
110 PRINT "POLICE SANITATION FIRE"
|
||||
120 FOR P = 2 TO 7 STEP 2
|
||||
130 FOR S = 1 TO 7
|
||||
140 IF S <> P THEN
|
||||
150 LET F = 12 - P - S
|
||||
160 IF F <> S AND F <> P AND F >= 1 AND F <= 7 THEN
|
||||
170 PRINT USING " # # #": P, S, F
|
||||
180 END IF
|
||||
190 END IF
|
||||
200 NEXT S
|
||||
210 NEXT P
|
||||
220 END
|
||||
22
Task/Department-numbers/Ada/department-numbers.adb
Normal file
22
Task/Department-numbers/Ada/department-numbers.adb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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;
|
||||
14
Task/Department-numbers/Agena/department-numbers.agena
Normal file
14
Task/Department-numbers/Agena/department-numbers.agena
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Department numbers
|
||||
scope
|
||||
print('POLICE SANITATION FIRE');
|
||||
for p from 2 to 7 by 2 do
|
||||
for s to 7 do
|
||||
if s <> p then
|
||||
f := 12 - p - s
|
||||
if f <> s and f <> p and f >= 1 and f <= 7 then
|
||||
printf(" %1d %1d %1d\n", p, s, f)
|
||||
fi
|
||||
fi
|
||||
od
|
||||
od
|
||||
epocs
|
||||
37
Task/Department-numbers/COBOL/department-numbers.cob
Normal file
37
Task/Department-numbers/COBOL/department-numbers.cob
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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.
|
||||
5
Task/Department-numbers/Icon/department-numbers.icon
Normal file
5
Task/Department-numbers/Icon/department-numbers.icon
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
procedure main()
|
||||
every writes(center("police"|"sanitation"|"fire",12)|"\n")
|
||||
every ((p:=2|4|6)~=(s := 1 to 7)~=(f := 1 to 7),p+s+f=12) do
|
||||
every writes(center(p|s|f,12)|"\n")
|
||||
end
|
||||
27
Task/Department-numbers/Oberon-07/department-numbers.oberon
Normal file
27
Task/Department-numbers/Oberon-07/department-numbers.oberon
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
MODULE DepartmentNumbers;
|
||||
(* show possible department number allocations for police, sanitation and fire departments *)
|
||||
(* the police department number must be even, all department numbers in the range 1 .. 7 *)
|
||||
(* the sum of the department numbers must be 12 *)
|
||||
|
||||
IMPORT Out;
|
||||
|
||||
CONST maxDepartmentNumber = 7;
|
||||
departmentSum = 12;
|
||||
VAR police, sanitation, fire : INTEGER;
|
||||
|
||||
BEGIN
|
||||
Out.String( "police sanitation fire" );Out.Ln;
|
||||
FOR police := 2 TO maxDepartmentNumber BY 2 DO
|
||||
FOR sanitation := 1 TO maxDepartmentNumber DO
|
||||
IF sanitation # police THEN
|
||||
fire := ( departmentSum - police ) - sanitation;
|
||||
IF ( fire > 0 ) & ( fire <= maxDepartmentNumber )
|
||||
& ( fire # sanitation )
|
||||
& ( fire # police )
|
||||
THEN
|
||||
Out.Int( police, 6 );Out.Int( sanitation, 11 );Out.Int( fire, 5 );Out.Ln
|
||||
END
|
||||
END
|
||||
END
|
||||
END
|
||||
END DepartmentNumbers.
|
||||
17
Task/Department-numbers/Pluto/department-numbers.pluto
Normal file
17
Task/Department-numbers/Pluto/department-numbers.pluto
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
print("Police Sanitation Fire")
|
||||
print("------ ---------- ----")
|
||||
local count = 0
|
||||
for h = 1, 3 do
|
||||
local i = h * 2
|
||||
for j = 1, 7 do
|
||||
if j != i then
|
||||
for k = 1, 7 do
|
||||
if k != i and k != j and i + j + k == 12 then
|
||||
print($" {i} {j} {k}")
|
||||
++count
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
print($"\n{count} valid combinations")
|
||||
13
Task/Department-numbers/PowerShell/department-numbers.ps1
Normal file
13
Task/Department-numbers/PowerShell/department-numbers.ps1
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Department numbers
|
||||
|
||||
Write-Output "POLICE SANITATION FIRE"
|
||||
for ($p = 2; $p -le 7; $p += 2) {
|
||||
for ($s = 1; $s -le 7; $s++) {
|
||||
if ($s -ne $p) {
|
||||
$f = 12 - $p - $s
|
||||
if (($f -ne $s) -and ($f -ne $p) -and ($f -ge 1) -and ($f -le 7)) {
|
||||
Write-Output " $p $s $f"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Task/Department-numbers/Uiua/department-numbers.uiua
Normal file
1
Task/Department-numbers/Uiua/department-numbers.uiua
Normal file
|
|
@ -0,0 +1 @@
|
|||
▽=0◿2⊸≡⊢▽=12⊸≡/+⧅≠3 +1⇡7
|
||||
Loading…
Add table
Add a link
Reference in a new issue