//JS pseudo TurboPascal simulator script //program dreieck; {Lutz Tautenhahn (c) 1995,1999} var xmax=640; var ymax=480; var d=[60,65,71,78,85,93,101,110]; var zr, n=0; var zx0,zx1,zy0,zy1; var x=[],y=[]; var graphdriver,graphmode; var i; function run() { if (nreadln<1) { initgraph(); x[0]=320-5*d[n]; y[0]=480-8*d[n]; x[1]=320; y[1]=480; x[2]=320+5*d[n]; y[2]=480-8*d[n]; zx0=x[0]; zy0=y[0]; for (i=1; i<=100000; i++) { zr=Math.floor(Math.random()*3); zx1=(zx0+x[zr])/2; zy1=(zy0+y[zr])/2; putpixel(Math.round(zx1),Math.round(zy1),15); zx0=zx1; zy0=zy1; } n=(n+1)%8; if (n>0) nreadln--; readln(''); return; } closegraph(); exit(); }