basic: making function 'call' within the function-type argument sorta works when you strictly curry them; literal function call seems to return undefined or something (see assets/disk0/home/basic/sinc2.bas)

This commit is contained in:
minjaesong
2020-12-24 15:47:54 +09:00
parent 1c3e7c3c15
commit 85334beff8
3 changed files with 30 additions and 21 deletions

View File

@@ -5,12 +5,12 @@
110 Q=IF I==0 THEN 1.0 ELSE SIN(I)/I
120 RETURN
200 LABEL PLOTLINE:REM Converts 0-1 value into screen line. input is Q, results are stored to SQ
210 SQ=CHR(0)
210 SQ=""
220 FOR X=1 TO ZEROLINE+AMP
230 SQ=SQ+(IF X==ROUND(ZEROLINE+Q*AMP) THEN "@" ELSE IF X==10 THEN "|" ELSE CHR(250))
240 NEXT
250 RETURN
1000 FOR I=0 TO 20
1000 FOR I=-40 TO 40
1010 GOSUB SINCQ
1020 GOSUB PLOTLINE
1030 PRINT(SQ)