'=========================================================================== ' Subject: MATRIX SCREEN PAINT DEMO Date: 01-28-96 (11:23) ' Author: David A. Wicker Code: QB, QBasic, PDS ' Origin: david@fastlane.net Packet: GRAPHICS.ABC '=========================================================================== DEFINT A-Z ' * Matrix Paint (C) 1996+ David A. Wicker CLS LOCATE 12, 1 PRINT "MATRIX SCREEN PAINT DEMO" PRINT "Use arrow keys (with NUM-LOCK lit), and [CR] to paint region" PRINT "[ESC] to exit demo." PRINT INPUT "", A$ SCREEN 1 DEF FNR (A) = INT(RND * A) RANDOMIZE TIMER FOR I = 1 TO 50 LINE (FNR(320), FNR(200))-(FNR(320), FNR(200)) NEXT Again: DO C = POINT(H, V) PSET (H, V), 1 DO K$ = INKEY$ LOOP UNTIL K$ > "" IF K$ = CHR$(27) THEN SCREEN 0 WIDTH 80 LOCATE 12, 1 PRINT "Matrix Screen Painter (C) 1996+ David A. Wicker" END END IF PSET (H, V), C IF K$ = "8" THEN V = V - 5 IF K$ = "2" THEN V = V + 5 IF K$ = "4" THEN H = H - 5 IF K$ = "6" THEN H = H + 5 LOOP UNTIL K$ = CHR$(13) PSET (H, V), 1 DO OK = 1 FOR I = 0 TO 199 FOR J = 0 TO 319 IF POINT(J, I) = 1 THEN IF POINT(J + 1, I) = 0 THEN PSET (J + 1, I), 1: OK = 0 IF POINT(J, I + 1) = 0 THEN PSET (J, I + 1), 1: OK = 0 END IF IF POINT(319 - J, 199 - I) = 1 THEN IF POINT(318 - J, 199 - I) = 0 THEN PSET (318 - J, 199 - I), 1: OK = 0 IF POINT(319 - J, 198 - I) = 0 THEN PSET (319 - J, 198 - I), 1: OK = 0 END IF NEXT NEXT LOOP UNTIL OK = 1 SOUND 800, .1 GOTO Again