Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion for the Syntax section
#20
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 :
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)