// enter program
norefresh

//this function is currently not used
number max x y
{
   smaller? x y
   {
      set max y
   }
   notsmaller? x y
   {
      set max x
   }
   value max
}

//currently not used
command smallLine x1 y1 x2 y2
{
   line x1 y1 x2 y2
   set dx (x2 - x1)
   set dy (y2 - y1)
   //normalize dx,dy
   set m <max dx dy>
   same? dx m
   {
      set dy (dy*100/dx)
      set dx 100
   }
   same? dy m
   {
      set dx (dx*100/dy)
      set dy 100
   }
   set f1 (x1+dx/10-dy/20-1)
   set f2 (y1+dy/10+dx/20-1)

   field f1 f2 (f1+2) (f2+2) 50

   set f1 (x1+dx/10+dy/20-1)
   set f2 (y1+dy/10-dx/20-1)

   field f1 f2 (f1+2) (f2+2) 50
}

command MyOldLine
{
   line 0 0 15 15
   smallLine 15 15 25 35
   smallLine 25 35 40 40
   smallLine 40 40 42 60
   smallLine 42 60 60 60
   smallLine 60 60 75 82
   smallLine 75 82 87 79
   line 87 79 100 100
}

command MyLine
{
   line 6 50 94 50
   field 8 52 10 54 50
   field 90 46 92 48 100
   //field 80 46 82 48 100
   field 70 46 72 48 100
   //field 60 46 62 48 100
   field 50 46 52 48 100
   //field 40 46 42 48 100
   field 30 46 32 48 100
   repeat i 8 90
   {
      field i 46 (i+2) 48 100
      refresh
      pause 1
      field i 46 (i+2) 48 0
   }
   field 90 46 92 48 100
}

MyLine