! CPL plotting primitives are mapped to gnuplot commands ! ====================================================== USE gnuplot INTEGER n ASK "How many? ":n ! ask the console user REAL Fib(0..n) ! variable dimensions are allowed Fib(0)=0; Fib(1)=1 ! initialize recursion LOOP FOR i=2 TO n ! fill up array of Fibonacci values Fib(i)=Fib(i-1)+Fib(i-2) REPEAT LOOP PLOT Fib ! plot the array against its index. READ ! wait on input and keep plot displayed until Enter is pressed