mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
basic: example program FUNCTION PLOTTER
This commit is contained in:
17
assets/sinc1.bas
Normal file
17
assets/sinc1.bas
Normal file
@@ -0,0 +1,17 @@
|
||||
1 GOTO 1000
|
||||
100 LABEL SINCQ:REM gets Sinc(Q)
|
||||
110 Q=SIN(I)/I
|
||||
120 RETURN
|
||||
200 LABEL TOSPC
|
||||
201 REM Converts 0-1 value into screen line
|
||||
202 REM input is Q, results are stored to SQ
|
||||
210 SQ="I":REM currently empty string literals can't be used because of bug
|
||||
220 FOR X=1 TO 10 MAX 10+Q*20
|
||||
230 SQ=SQ+(IF X==FIX(10+Q*20) THEN "@" ELSE IF X==10 THEN ":" ELSE " ")
|
||||
240 NEXT
|
||||
250 RETURN
|
||||
1000 FOR I=1 TO 20
|
||||
1010 GOSUB SINCQ
|
||||
1020 GOSUB TOSPC
|
||||
1030 PRINT(SQ)
|
||||
1040 NEXT
|
||||
Reference in New Issue
Block a user