Easylang demo

A tree is a piece of wood with smaller trees attached to it.


gcolor 445
proc tree x y angle depth .
   glinewidth depth * 0.4
   xn = x + cos angle * depth * 1.4 * (randomf + 0.5)
   yn = y + sin angle * depth * 1.4 * (randomf + 0.5)
   gline x y xn yn
   if depth > 1
      tree xn, yn, angle - 20, depth - 1
      tree xn, yn, angle + 20, depth - 1
   .
.
tree 50 10 90 10

 


Reaction Tester


gbackground 000
subr wait
   gclear
   gcolor 733
   gtext 20 50 "WAIT"
   timer 1 + 2 * randomf
.
on timer
   gclear
   gcolor 373
   gtext 20 50 "PRESS"
   time0 = systime
.
on mouse_down
   if time0 <> 0
      gclear
      gcolor 555
      gtext 20, 50, systime - time0
      time0 = 0
   else
      wait
   .
.
gtextsize 20
wait