01-08-2014, 12:11 AM
Quote:I think code without line numbers should be respected
Code:
5 :
7 REM ZX Spectrum BASIC without line numbers
8 REM written by Zarsoft
9 :
10 REM init subrotines
15 LET factorial=100:
19 :
20 REM ----------------------
21 REM test factorial
22 REM ----------------------
30 PRINT "max= ";:
INPUT max:
PRINT :
FOR n=1 TO max:
GO SUB factorial:
PRINT "fact(";n;")= ";result:
NEXT n:
STOP :
GO TO 10000
95 :
100 REM ----------------------
101 REM factorial
102 REM ----------------------
110 LET result=n:
FOR f=n-1 TO 2 STEP -1:
LET result=result*f:
NEXT f:
RETURN
999 :