2 CLS 5 LET pi=3.14159 9 k=32 10 dim res(k) 20 let s0=0 30 let s1=1080 # step is a keyword presumably 40 let ds = (s1-s0)/(k-1) 50 for i = 0 to k-1 60 let x = s0 + i*ds # now we have to fix this because the approximation is only good close to 0 61 x = x mod 360 62 x = (x - 180)/180*pi 70 gosub 200 80 res(i+1) = cosx 90 next i 100 GOTO 300 200 REM cosine 210 LET x2 = x * x 220 LET x4 = x2 * x2 230 LET x6 = x4 * x2 240 LET f2 = 2 250 LET f4 = f2 * 3 * 4 260 LET f6 = f4 * 5 * 6 270 LET cosx = 1 - x2/f2 + x4/f4 - x6/f6 280 RETURN # shift by 1, divide by 2, multiply by num of rows, integerize, and print 300 for j = 0 to 6 305 for i=0 to k-1 310 let v=res(i+1) 320 v=(v+1)/2 321 if v > 1 then v = 1 322 if v < 0 then v = 0 330 v=int(v*7) 335 if v <> j then goto 360 340 position i,v # we clear lines in the middle rows, probably because of screen behavior 350 print "X" # 351 pause 200 360 next i 370 next j