dos_compilers/Digital Research CB-86 v2/E.BAS
2024-07-04 06:38:15 -07:00

29 lines
570 B
QBasic
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

100 DIGITS% = 200
110 DIM A%( 200 )
120 HIGH% = DIGITS%
130 X% = 0
140 N% = HIGH% - 1
150 IF N% <= 0 THEN GOTO 200
160 A%( N% ) = 1
170 N% = N% - 1
180 GOTO 150
200 A%( 1 ) = 2
210 A%( 0 ) = 0
220 IF HIGH% <= 9 THEN GOTO 400
230 HIGH% = HIGH% - 1
235 N% = HIGH%
240 IF N% = 0 THEN GOTO 300
250 A%( N% ) = MOD( X%, N% )
260 X% = ( 10 * A%( N% - 1 ) ) + ( X% / N% )
270 N% = N% - 1
280 GOTO 240
300 IF X% >= 10 THEN GOTO 330
310 PRINT USING "#"; X%;
320 GOTO 220
330 PRINT USING "##"; X%;
340 GOTO 220
400 PRINT ""
410 PRINT "done"
420 STOP