Count in octal: Difference between revisions
→{{header|Chipmunk Basic}}: Added.
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(→{{header|Chipmunk Basic}}: Added.) |
||
Line 764:
However, many do not. For those BASICs, we need to write our own function.
{{works with|Chipmunk Basic}}▼
<syntaxhighlight lang="qbasic">WHILE ("" = INKEY$)
Line 810 ⟶ 808:
</syntaxhighlight>
<syntaxhighlight lang="basic">
10 rem Count in ocatal
20 while ("" = inkey$ )
30 print octal$(n)
40 n = n+1
50 wend
60 end
200 function octal$(what)
210 outp$ = ""
220 w = what
230 while abs(w) > 0
240 o = w and 7
250 w = int(w/8)
260 outp$ = str$(o)+outp$
270 wend
280 octal$ = outp$
290 end function
</syntaxhighlight>
==={{header|Commodore BASIC}}===
|