Department numbers: Difference between revisions

→‎{{header|Minimal BASIC}}: Corrected. Minimal BASIC does not have the operators OR, AND, NOT.
(→‎{{header|UNIX Shell}}: Add implementation)
(→‎{{header|Minimal BASIC}}: Corrected. Minimal BASIC does not have the operators OR, AND, NOT.)
Line 941:
==={{header|Minimal BASIC}}===
{{trans|Sinclair ZX81 BASIC}}
<syntaxhighlight lang="gwbasicbasic">
10 REM Department numbers
20 PRINT "POLICE SANITATION FIRE"
30 FOR P = 2 TO 7 STEP 2
40 FOR S = 1 TO 7
50 IF S = P THEN 90120
60 LET F = (12-P)-S
70 IF F <= 0 OR F > 7 OR F = S OR F = P THEN 90120
80 IF F > 7 THEN 120
80 PRINT TAB(3); P; TAB(11); S; TAB(19); F
90 NEXTIF F = S THEN 120
100 NEXTIF F = P THEN 120
80110 PRINT TAB(3); P; TAB(11); S; TAB(19); F
110 END
120 NEXT S
130 NEXT P
110140 END
</syntaxhighlight>
 
511

edits