! Write a subroutine to clear the entire screen and
! fill it with an 80 by 24 grid of dots.
! Such a subroutine might be used in a
! computer graphics program.
! Test the program with i >= 3, j >= 5 first, do trace, slow (i,j)
! Set i >= 24, j >= 80
! Test the program with do trace, fast(i,j)
DO until i >= 24
LET j= 0
DO until j >= 80 !write a row of periods
LET j=j+1
PRINT ".";
LOOP
PRINT !go to the next line
LET i = i + 1
IF mod(i,2) > 0 then
SET COLOR "red"
ELSE
SET COLOR "blue"
END IF
LOOP
SOUND 1000 ,.1
END
The output:
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................