Josephus problem: Difference between revisions

→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.
m (ANSI Standard BASIC and BBC BASIC moved to the BASIC section.)
(→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.)
Line 1,026:
<pre>Survivor is number 30</pre>
 
==={{header|ANSI Standard BASIC}}===
{{trans|ALGOL 68}}
{{works with|Decimal BASIC}}
<syntaxhighlight lang="ansi standard basic">100 FUNCTION josephus (n, k, m)
110 ! Return m-th on the reversed kill list; m=0 is final survivor.
120 LET lm = m ! Local copy OF m
Line 1,041 ⟶ 1,042:
210 END
</syntaxhighlight>
{{out}}
<pre>
n = 41 k = 3 final survivor = 30
</pre>
 
==={{header|Applesoft BASIC}}===
511

edits