• One more:

    function f() {'compiled'; 
      Xr=0;
      Xi=0;
      i=0;
      while ((i<16) & ((Xr*Xr+Xi*Xi)<4))  {
        t=Xr*Xr - Xi*Xi + Cr;
        Xi=2*Xr*Xi+Ci;
        Xr=t;
        i=i+1;
      }
    }
    
    var i,t,Xr,Xi,Cr,Ci;
    
    for (y=0;y<32;y++) {
      line="";
      Ci=(4.0*y/32)-2.0;
      for (x=0;x<32;x++) {
        Cr=(4.0*x/32)-2.0;  
        f();
        line += (i&1)?"*":" ";
       }
       print(line);
    }
    

    So locking is now sorted and this is powerful enough for while loops - for instance for the mandelbrot fractal. There's some minor glitch with the maths but it looks very promising.

    Interestingly this still isn't super fast because of the variable lookup, but that's something that will change soon too!

About

Avatar for Gordon @Gordon started