RosettaCodeData/Task/Count-in-octal/Commodore-BASIC/count-in-octal.basic
2023-07-01 13:44:08 -04:00

12 lines
210 B
Text

10 n=0
20 gosub 70
30 print oc$
40 n=n+1
50 get a$:if a$<>"q" then goto 20
60 end
70 oc$="":t=n
80 q=int(t/8)
90 r=t-(q*8)
100 oc$=left$(str$(n),1)+right$(str$(r),1)+oc$
110 if q<>0 then t=q:goto 80
120 return