Department numbers: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) m syntax highlighting fixup automation |
|||
Line 954:
110 END
</syntaxhighlight>
==={{header|Quite BASIC}}===
{{trans|Sinclair ZX81 BASIC}}
<syntaxhighlight lang="basic">
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 80
60 LET F = (12-P)-S
70 IF F > 0 AND F <= 7 AND F <> S AND F <> P THEN PRINT " ";P;" ";S;" ";F
80 NEXT S
90 NEXT P
100 END
</syntaxhighlight>
{{out}}
<pre>
POLICE SANITATION FIRE
2 3 7
2 4 6
2 6 4
2 7 3
4 1 7
4 2 6
4 3 5
4 5 3
4 6 2
4 7 1
6 1 5
6 2 4
6 4 2
6 5 1
</pre>
==={{header|Sinclair ZX81 BASIC}}===
|