mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-17 00:16:04 +09:00
moving everything neatly into the assets directory
This commit is contained in:
17
assets/disk0/home/basic/sinc2.bas
Normal file
17
assets/disk0/home/basic/sinc2.bas
Normal file
@@ -0,0 +1,17 @@
|
||||
1 ZEROLINE=10
|
||||
2 AMP=20
|
||||
10 DEFUN SINC(P)=IF P==0 THEN 1.0 ELSE SIN(P)/P
|
||||
20 DEFUN TOCHAR(P,X)=IF (X==ROUND(ZEROLINE+P*AMP)) THEN "@" ELSE IF (X==ZEROLINE) THEN "|" ELSE CHR(250)
|
||||
30 DEFUN SCONCAT(ACC,S)=ACC+S
|
||||
40 REM DEFUN PLOTLINE(X)=FOLD(SCONCAT,CHR(0),MAP(TOCHAR<~X,1 TO ZEROLINE+AMP))
|
||||
41 DEFUN PLOTLINE(F,X)=FOLD(SCONCAT,CHR(0),MAP(TOCHAR<~F(X),1 TO ZEROLINE+AMP))
|
||||
100 FOR I=0 TO 20
|
||||
110 PRINT PLOTLINE(SINC(I))
|
||||
120 NEXT
|
||||
999 END
|
||||
|
||||
1000 REM Known bugs
|
||||
1010 DEFUN PLOTLINE(F,X)=FOLD(SCONCAT,CHR(0),MAP(TOCHAR<~F(X),1 TO ZEROLINE+AMP))
|
||||
1011 REM calling user-defined function within DEFUN is not working
|
||||
|
||||
1020 REM empty string literal "" is translated to number zero (another JS blunder)
|
||||
Reference in New Issue
Block a user