mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
basic: confirming that high-order function is working properly?
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
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 DEFUN PLOTLINE(F,X)=FOLD(SCONCAT,"",MAP(TOCHAR~<F~<X,1 TO ZEROLINE+AMP))
|
||||
40 DEFUN PLOTLINE(F,X)=FOLD(SCONCAT,"",MAP(TOCHAR~<F(X),1 TO ZEROLINE+AMP))
|
||||
100 FOR I=-40 TO 40
|
||||
110 PRINT PLOTLINE(SINC,I)
|
||||
120 NEXT
|
||||
|
||||
Reference in New Issue
Block a user