LINE DRAWER (ZX81)
by Guy Brooker, St Albans, Hertfordshire
from Your Computer (November 1981), Page 68

In the ZX81 manual, in chapter 18 on graphics, there is an exercise
containing a subroutine which plots a line between two pixel coordinates on
the screen. Line Drawer performs the same function at half the length of
the program in the manual and using fewer vriables. This means it would be
very useful to a 1K machine owner.

The variables X2,Y2 - the co-ordinates of the end of the line - and X1,Y1 -
the co-ordinates of the beginning of the line - must be initialised before
entering the subroutine.

It drawa the line by first finding the height and width of the line then
starts a loop which is as long as the greater of these two. Having plotted
the first position, it increments the current co-ordinates by the fractions
width over greater length and height over greater length. It continues the
loop until the final pixel is reached and returns to the main program.
