' LINE-1.BAS
' This program demonstrates the LINE statement.

CLS

INPUT "Please enter a screen mode (0-13):  ", modeNum%
INPUT "How many colors?  ", numColors%
SCREEN modeNum%

CONST DELAY% = 100                           ' controls delay between
                                             '   each line drawn
DO
    shade% = INT(RND(1) * numColors%) + 1    ' line color
    x1pos% = INT(RND(1) * 320)               ' start coordinates
    y1pos% = INT(RND(1) * 200)
    x2pos% = INT(RND(1) * 320)               ' end coordinates
    y2pos% = INT(RND(1) * 200)
    LINE (x1pos%, y1pos%)-(x2pos%, y2pos%), shade%
   
    FOR i% = 1 TO DELAY%                     ' delay loop
    NEXT i%

LOOP WHILE INKEY$ = ""

