ZX81 Listing for fizzbuzz2.p


ZX81 program listing for **FIZZBUZZ2**SLR/2023**

**FIZZBUZZ2**SLR/2023** (fizzbuzz2.p)

My updated FizzBuzz using a faster number print routine.


SYSTEM VARIABLES

PROG  : 16509
D-FILE: 17269
VARS  : 18062
E-LINE: 18063
STKBOT: 18063
STKEND: 18063


LEGEND

9999 means line number
PRINT means treat as KEYWORD P


PROGRAM LISTING

  10 REM **FIZZBUZZ2**SLR/2023**
  20 GOSUB 250
  30 FOR I=1 TO 100
  40 GOSUB 300
  50 SCROLL
  60 LET FIZZ=NOT I-3*INT (I/3)
  70 LET BUZZ=NOT I-5*INT (I/5)
  80 IF FIZZ THEN PRINT "FIZZ";
  90 IF BUZZ THEN PRINT "BUZZ";
 100 IF NOT (FIZZ OR BUZZ) THEN
GOSUB 400
 110 NEXT I
 120 FOR P=1 TO 50
 130 PRINT AT VAL T$,VAL Z$;"FIZ
ZBUZZ"
 140 PRINT AT VAL T$,VAL Z$;"FIZ
ZBUZZ"
 150 NEXT P
 160 CLS
 170 RUN
 200 SAVE "FIZZBUZZ"
 210 RUN
 250 LET N$="0123456789"
 260 DIM D(3)
 280 LET T$="PI*PI+1"
 290 LET Z$="NOT PI"
 300 LET D(1)=D(1)+1
 310 IF D(1)<11 THEN RETURN
 320 LET D(2)=D(2)+1+(1 AND NOT
D(2))
 330 LET D(1)=1
 340 IF D(2)<11 THEN RETURN
 350 LET D(3)=D(3)+1+(1 AND NOT
D(3))
 360 LET D(2)=1
 370 RETURN
 400 IF D(3) THEN PRINT N$(D(3))
;
 410 IF D(2) THEN PRINT N$(D(2))
;
 420 PRINT N$(D(1));
 430 RETURN