'=========================================================================== ' Subject: QB IMAGE DRAW Date: 05-26-99 (11:31) ' Author: Paul Crosland Code: QB, QBasic, PDS ' Origin: xflare@hotmail.com Packet: GRAPHICS.ABC '=========================================================================== 'QB IMAGE DRAW Copyright (c) 1998-1999 XFlareSoft. ' 'This program was designed by Paul Crosland and is intended to offer 'a pleasant alternative to designing QBasic graphics with features 'such as color converting and rotating images. 20 animation frames 'allows you to test your graphics while simultaneously designing them. 'There are two save modes, one for up to 100 pixels, and another for up 'to 400 pixels. Use the DIM command to define the image area. To 'use this program's palette in your own programs, copy the CHGCOLORS sub. 'If you use a screen other than 9, you will have to redefine the attribute 'numbers, probably by simple experimentation. For screen 13 however, just 'change the AT row to "00010203040506070809101112131415". ' 'You may distribute this program only if everything remains intact. 'Please send any comments and/or suggestions to xflare@hotmail.com. DECLARE SUB CHGCOLORS () DECLARE SUB SCROLL () DECLARE SUB SPRAY () DECLARE SUB TEXTURE () DECLARE SUB DIMENSIONS () DECLARE SUB CONVERT () DECLARE SUB ROTATE () DECLARE SUB FINDFILE () DECLARE SUB SAVEFILE () DECLARE SUB SAFEMODE () DECLARE SUB SCREENSET () DECLARE SUB ANIMATION () DECLARE SUB CURCHANGE () DIM SHARED image(100), pcol(400), afile$(20), fafile$(20), prafile$(20) DIM SHARED image1(100), image2(100), image3(100), image4(100), image5(100) DIM SHARED image6(100), image7(100), image8(100), image9(100), image10(100) DIM SHARED image11(100), image12(100), image13(100), image14(100) DIM SHARED image15(100), image16(100), image17(100), image18(100) DIM SHARED image19(100), image20(100) COMMON SHARED sel$, xcursor1, xcursor2, ycursor, box, col, file$, stat COMMON SHARED prfile$, adelay, xdim1, ydim1, xdim2, ydim2, curdelay, cursor$ COMMON SHARED erry, errx, cutshort$, intense xdim1 = 0: ydim1 = 0: xdim2 = 19: ydim2 = 19 erry = 23: errx = 31 cutshort$ = "no" intense = 11 FOR num = 1 TO 20 afile$(num) = "c:\" NEXT SCREEN 9, 0, 0, 0: CLS ON ERROR GOTO errortrap RANDOMIZE TIMER CALL CHGCOLORS CALL SCREENSET DO sel$ = INKEY$ SELECT CASE UCASE$(sel$) CASE "C" IF box = 1 THEN box = 2 ELSE box = 1 END IF CASE CHR$(0) + CHR$(72) IF box = 2 THEN LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 4, B ycursor = ycursor - 10 IF ycursor < 100 + ydim1 * 10 THEN ycursor = 100 + ydim2 * 10 END IF CASE CHR$(0) + CHR$(80) IF box = 2 THEN LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 4, B ycursor = ycursor + 10 IF ycursor > 100 + ydim2 * 10 THEN ycursor = 100 + ydim1 * 10 END IF CASE CHR$(0) + CHR$(75) IF box = 1 THEN LINE (xcursor1, 34)-(xcursor1 + 30, 64), 4, B xcursor1 = xcursor1 - 30: IF xcursor1 < 70 THEN xcursor1 = 520 ELSEIF box = 2 THEN LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 4, B xcursor2 = xcursor2 - 10 IF xcursor2 < 210 + xdim1 * 10 THEN xcursor2 = 210 + xdim2 * 10 END IF CASE CHR$(0) + CHR$(77) IF box = 1 THEN LINE (xcursor1, 34)-(xcursor1 + 30, 64), 4, B xcursor1 = xcursor1 + 30: IF xcursor1 > 520 THEN xcursor1 = 70 ELSEIF box = 2 THEN LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 4, B xcursor2 = xcursor2 + 10 IF xcursor2 > 210 + xdim2 * 10 THEN xcursor2 = 210 + xdim1 * 10 END IF CASE CHR$(13) IF box = 1 THEN col = POINT(xcursor1 + 2, 36): box = 2 ELSEIF box = 2 THEN LINE (xcursor2 + 2, ycursor + 2)-(xcursor2 + 8, ycursor + 8), col, BF PSET (xcursor2 / 10 + 469, ycursor / 10 + 230), col END IF CASE "Q", CHR$(27) CALL SAFEMODE: IF sel$ = "Y" THEN SCREEN 9, 0, 0, 0: CLS : CLEAR : END CASE "N" CALL SAFEMODE: IF sel$ = "Y" THEN CALL SCREENSET CASE "O" CALL FINDFILE CASE "S" CALL SAVEFILE CASE "R" IF xdim1 = ydim1 AND xdim2 = ydim2 THEN CALL ROTATE CASE "V" CALL SAFEMODE: IF sel$ = "Y" THEN CALL CONVERT CASE "L" CALL SCROLL CASE "D" CALL DIMENSIONS CASE "A" CALL ANIMATION CASE "P" CALL SPRAY END SELECT LINE (210 + xdim1 * 10, 100 + ydim1 * 10)-(220 + xdim2 * 10, 110 + ydim2 * 10), 12, B LINE (xcursor1, 34)-(xcursor1 + 30, 64), 8, B LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 8, B LINE (490, 140)-(509, 159), col, BF xcoor = xcursor2 / 10 - 21 - xdim1 ycoor = ycursor / 10 - 10 - ydim1 IF xcoor < 10 AND ycoor < 10 THEN text$ = "0# - 0#" IF xcoor > 9 AND ycoor > 9 THEN text$ = "## - ##" IF xcoor > 9 AND ycoor < 10 THEN text$ = "## - 0#" IF xcoor < 10 AND ycoor > 9 THEN text$ = "0# - ##" IF LEN(file$) < 4 THEN name$ = "UNTITLED" ELSE name$ = UCASE$(file$) + ".GPH" END IF LOCATE 7, 30: PRINT STRING$(20, " ") LOCATE 7, 40 - (LEN(name$)) / 2: COLOR 12: PRINT name$ LOCATE 15, 60: COLOR 4: PRINT USING text$; xcoor; ycoor PCOPY 1, 0 LOOP errortrap: LOCATE erry, errx - 1: PRINT STRING$(22, " ") LOCATE erry, errx: COLOR 8: PRINT "INVALID FILE NAME" cutshort$ = "yes" PCOPY 1, 0 time1# = TIMER: DO: time2# = TIMER: LOOP UNTIL time2# - time1# > 1 LOCATE erry, errx: PRINT STRING$(20, " ") RESUME NEXT SUB ANIMATION frame = 1 IF adelay = 0 THEN adelay = 10 cursor$ = "_": curdelay = 10 animate$ = "no" erry = 11: errx = 5 FOR num = 1 TO 10 prafile$(num) = afile$(num) NEXT DO LOCATE 10, 3: PRINT STRING$(22, " ") LOCATE 11, 3: PRINT STRING$(22, " ") COLOR 12: LOCATE 10, 3: PRINT "FRAME"; frame COLOR 4: LOCATE 11, 3: PRINT ">>> "; afile$(frame) + cursor$ sel$ = INKEY$ SELECT CASE UCASE$(sel$) CASE "A" TO "Z", "\", "/", ":", "0" TO "9" IF LEN(afile$(frame)) < 18 THEN afile$(frame) = afile$(frame) + sel$ CASE CHR$(8) IF LEN(afile$(frame)) > 0 THEN afile$(frame) = LEFT$(afile$(frame), LEN(afile$(frame)) - 1) CASE CHR$(13) animate$ = "yes": EXIT DO CASE CHR$(27) cutshort$ = "yes": EXIT DO animate$ = "no" CASE CHR$(0) + CHR$(72) frame = frame + 1: IF frame = 21 THEN frame = 1 CASE CHR$(0) + CHR$(80) frame = frame - 1: IF frame = 0 THEN frame = 20 END SELECT CALL CURCHANGE IF LEN(afile$(frame)) = 18 THEN cursor$ = " " PCOPY 1, 0 LOOP IF animate$ = "yes" THEN FOR num = 1 TO 20 IF LEN(afile$(num)) > 3 THEN maxframe = num fafile$(num) = afile$(num) + ".gph" ELSE EXIT FOR END IF NEXT FOR num = 1 TO 20 IF maxframe < num THEN afile$(num) = "c:\" NEXT LOCATE 10, 3: PRINT STRING$(22, " "): LOCATE 11, 3: PRINT STRING$(22, " ") IF maxframe > 19 THEN DEF SEG = VARSEG(image20(0)): BLOAD fafile$(20), VARPTR(image20(0)) IF maxframe > 18 THEN DEF SEG = VARSEG(image19(0)): BLOAD fafile$(19), VARPTR(image19(0)) IF maxframe > 17 THEN DEF SEG = VARSEG(image18(0)): BLOAD fafile$(18), VARPTR(image18(0)) IF maxframe > 16 THEN DEF SEG = VARSEG(image17(0)): BLOAD fafile$(17), VARPTR(image17(0)) IF maxframe > 15 THEN DEF SEG = VARSEG(image16(0)): BLOAD fafile$(16), VARPTR(image16(0)) IF maxframe > 14 THEN DEF SEG = VARSEG(image15(0)): BLOAD fafile$(15), VARPTR(image15(0)) IF maxframe > 13 THEN DEF SEG = VARSEG(image14(0)): BLOAD fafile$(14), VARPTR(image14(0)) IF maxframe > 12 THEN DEF SEG = VARSEG(image13(0)): BLOAD fafile$(13), VARPTR(image13(0)) IF maxframe > 11 THEN DEF SEG = VARSEG(image12(0)): BLOAD fafile$(12), VARPTR(image12(0)) IF maxframe > 10 THEN DEF SEG = VARSEG(image11(0)): BLOAD fafile$(11), VARPTR(image11(0)) IF maxframe > 9 THEN DEF SEG = VARSEG(image10(0)): BLOAD fafile$(10), VARPTR(image10(0)) IF maxframe > 8 THEN DEF SEG = VARSEG(image9(0)): BLOAD fafile$(9), VARPTR(image9(0)) IF maxframe > 7 THEN DEF SEG = VARSEG(image8(0)): BLOAD fafile$(8), VARPTR(image8(0)) IF maxframe > 6 THEN DEF SEG = VARSEG(image7(0)): BLOAD fafile$(7), VARPTR(image7(0)) IF maxframe > 5 THEN DEF SEG = VARSEG(image6(0)): BLOAD fafile$(6), VARPTR(image6(0)) IF maxframe > 4 THEN DEF SEG = VARSEG(image5(0)): BLOAD fafile$(5), VARPTR(image5(0)) IF maxframe > 3 THEN DEF SEG = VARSEG(image4(0)): BLOAD fafile$(4), VARPTR(image4(0)) IF maxframe > 2 THEN DEF SEG = VARSEG(image3(0)): BLOAD fafile$(3), VARPTR(image3(0)) IF maxframe > 1 THEN DEF SEG = VARSEG(image2(0)): BLOAD fafile$(2), VARPTR(image2(0)) IF maxframe > 0 THEN DEF SEG = VARSEG(image1(0)): BLOAD fafile$(1), VARPTR(image1(0)) frame = 1 IF maxframe = 0 THEN cutshort$ = "yes" IF cutshort$ = "no" THEN DO time1# = TIMER LOCATE 10, 5: COLOR 4: PRINT "USE THE ARROW KEYS" LOCATE 11, 5: PRINT "TO CHANGE THE SPEED" LOCATE 18, 10: COLOR 12: PRINT "DEL:"; adelay LOCATE 20, 5: COLOR 4: PRINT "PRESS ESC WHEN DONE" sel$ = INKEY$ SELECT CASE sel$ CASE CHR$(0) + CHR$(72) IF adelay < 20 THEN adelay = adelay + 1 CASE CHR$(0) + CHR$(80) IF adelay > 1 THEN adelay = adelay - 1 END SELECT IF frame = 1 THEN PUT (90, 190), image1, PSET IF frame = 2 THEN PUT (90, 190), image2, PSET IF frame = 3 THEN PUT (90, 190), image3, PSET IF frame = 4 THEN PUT (90, 190), image4, PSET IF frame = 5 THEN PUT (90, 190), image5, PSET IF frame = 6 THEN PUT (90, 190), image6, PSET IF frame = 7 THEN PUT (90, 190), image7, PSET IF frame = 8 THEN PUT (90, 190), image8, PSET IF frame = 9 THEN PUT (90, 190), image9, PSET IF frame = 10 THEN PUT (90, 190), image10, PSET IF frame = 11 THEN PUT (90, 190), image11, PSET IF frame = 12 THEN PUT (90, 190), image12, PSET IF frame = 13 THEN PUT (90, 190), image13, PSET IF frame = 14 THEN PUT (90, 190), image14, PSET IF frame = 15 THEN PUT (90, 190), image15, PSET IF frame = 16 THEN PUT (90, 190), image16, PSET IF frame = 17 THEN PUT (90, 190), image17, PSET IF frame = 18 THEN PUT (90, 190), image18, PSET IF frame = 19 THEN PUT (90, 190), image19, PSET IF frame = 20 THEN PUT (90, 190), image20, PSET frame = frame + 1: IF frame > maxframe THEN frame = 1 PCOPY 1, 0 DO: time2# = TIMER: LOOP UNTIL time2# - time1# > adelay / 100 LOOP UNTIL sel$ = CHR$(27) END IF END IF IF cutshort$ = "yes" THEN FOR num = 1 TO 10 afile$(num) = prafile$(num) NEXT cutshort$ = "no" END IF LOCATE 10, 5: PRINT STRING$(15, " ") LOCATE 11, 5: PRINT STRING$(15, " ") LOCATE 18, 10: PRINT STRING$(15, " ") LOCATE 20, 5: PRINT STRING$(20, " ") LOCATE 10, 3: PRINT STRING$(24, " ") LOCATE 11, 3: PRINT STRING$(24, " ") LOCATE 18, 10: PRINT STRING$(10, " ") LINE (90, 190)-(109, 209), 0, BF END SUB SUB CHGCOLORS FOR CL = 0 TO 15 AT = VAL(MID$("00010203040520075657585960616263", CL * 2 + 1, 2)) RD = VAL(MID$("05152540605055456002100402020202", CL * 2 + 1, 2)) GR = VAL(MID$("05152540604050020225354555101530", CL * 2 + 1, 2)) BL = VAL(MID$("05152540600202040210051002406060", CL * 2 + 1, 2)) OUT &H3C8, AT: OUT &H3C9, RD: OUT &H3C9, GR: OUT &H3C9, BL NEXT END SUB SUB CONVERT chgcol = POINT(xcursor2 + 2, ycursor + 2) x = 210 + xdim1 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) pcol(num) = POINT(x + 2, y + 2) IF pcol(num) = chgcol THEN LINE (x + 2, y + 2)-(x + 8, y + 8), col, BF PSET (x / 10 + 469, y / 10 + 230), col END IF x = x + 10: IF x = 220 + xdim2 * 10 THEN y = y + 10: x = 210 + xdim1 * 10 NEXT END SUB SUB CURCHANGE curdelay = curdelay - 1 IF curdelay = 0 THEN curdelay = 10 IF cursor$ = "_" THEN cursor$ = " " ELSEIF cursor$ = " " THEN cursor$ = "_" END IF END IF END SUB SUB DIMENSIONS lxdim1 = xdim1: lxdim2 = xdim2: lydim1 = ydim1: lydim2 = ydim2 LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 3, B LINE (210 + xdim1 * 10, 100 + ydim1 * 10)-(220 + xdim2 * 10, 110 + ydim2 * 10), 3, B stat = xdim1: text$ = "X1:" FOR num = 1 TO 4 DO LOCATE 23, 30: PRINT STRING$(20, " "): COLOR 4 IF stat < 10 THEN text2$ = " 0#" IF stat > 9 THEN text2$ = " ##" LOCATE 23, 37: PRINT text$; : PRINT USING text2$; stat sel$ = INKEY$ SELECT CASE sel$ CASE CHR$(0) + CHR$(72) IF stat < 19 THEN stat = stat + 1 CASE CHR$(0) + CHR$(80) IF stat > 0 THEN stat = stat - 1 CASE CHR$(27) EXIT DO CASE CHR$(13) IF num = 1 THEN xdim1 = stat IF num = 2 THEN ydim1 = stat IF num = 3 THEN xdim2 = stat IF num = 4 THEN ydim2 = stat EXIT DO END SELECT PCOPY 1, 0 LOOP IF num = 1 THEN stat = ydim1: text$ = "Y1:" ELSEIF num = 2 THEN stat = xdim2: text$ = "X2:" ELSEIF num = 3 THEN stat = ydim2: text$ = "Y2:" END IF IF sel$ = CHR$(27) THEN EXIT FOR NEXT LOCATE 23, 30: PRINT STRING$(20, " ") LINE (xcursor2, ycursor)-(xcursor2 + 10, ycursor + 10), 3, B IF xdim1 > xdim2 OR ydim1 > ydim2 THEN LOCATE 23, 31: COLOR 8: PRINT "INVALID DIMENSIONS" PCOPY 1, 0 time1# = TIMER: DO: time2# = TIMER: LOOP UNTIL time2# - time1# > 1 xdim1 = lxdim1: xdim2 = lxdim2: ydim1 = lydim1: ydim2 = lydim2 ELSE xcursor2 = 210 + xdim1 * 10: ycursor = 100 + ydim1 * 10 END IF IF xdim1 <> ydim1 OR xdim2 <> ydim2 THEN COLOR 1: LOCATE 25, 20: PRINT "R"; : COLOR 2: PRINT "OTATE"; ELSE COLOR 10: LOCATE 25, 20: PRINT "R"; : COLOR 12: PRINT "OTATE"; END IF LOCATE 23, 30: PRINT STRING$(20, " ") END SUB SUB FINDFILE erry = 23: errx = 31 cursor$ = "_": curdelay = 10 prfile$ = file$ DO LOCATE 23, 28: PRINT STRING$(24, " ") sel$ = INKEY$ SELECT CASE UCASE$(sel$) CASE "A" TO "Z", "\", "/", ":", "0" TO "9" IF LEN(file$) < 18 THEN file$ = file$ + sel$ CASE CHR$(8) IF LEN(file$) > 0 THEN file$ = LEFT$(file$, LEN(file$) - 1) CASE CHR$(13) open$ = "yes": EXIT DO CASE CHR$(27) open$ = "no": file$ = prfile$: EXIT DO END SELECT IF LEN(file$) = 18 THEN cursor$ = " " LOCATE 23, 28: COLOR 4: PRINT "OPEN: "; file$ + cursor$ CALL CURCHANGE PCOPY 1, 0 LOOP ffile$ = file$ + ".gph" IF open$ = "yes" THEN DEF SEG = VARSEG(image(0)): BLOAD ffile$, VARPTR(image(0)) IF cutshort$ = "yes" THEN open$ = "no" END IF IF open$ = "yes" THEN LINE (490, 240)-(509, 259), 0, BF PUT (490, 240), image, PSET x1 = 490: y1 = 240 x2 = 210: y2 = 100 FOR num = 1 TO 400 pcol(num) = POINT(x1, y1) LINE (x2 + 2, y2 + 2)-(x2 + 8, y2 + 8), pcol(num), BF x1 = x1 + 1: IF x1 = 510 THEN x1 = 490: y1 = y1 + 1 x2 = x2 + 10: IF x2 = 410 THEN y2 = y2 + 10: x2 = 210 NEXT END IF LOCATE 23, 28: PRINT STRING$(24, " ") IF cutshort$ = "yes" THEN file$ = prfile$: cutshort$ = "no" END SUB SUB ROTATE x = 210 + xdim1 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) pcol(num) = POINT(x + 2, y + 2) x = x + 10: IF x = 220 + xdim2 * 10 THEN y = y + 10: x = 210 + xdim1 * 10 NEXT x = 210 + xdim2 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) LINE (x + 2, y + 2)-(x + 8, y + 8), pcol(num), BF PSET (x / 10 + 469, y / 10 + 230), pcol(num) y = y + 10: IF y = 110 + ydim2 * 10 THEN y = 100 + ydim1 * 10: x = x - 10 NEXT END SUB SUB SAFEMODE SCREEN 9, 0, 0, 0 DO LOCATE 23, 30: COLOR 4: PRINT "ARE YOU SURE? (Y,N)" sel$ = INKEY$: sel$ = UCASE$(sel$) LOOP UNTIL sel$ = "Y" OR sel$ = "N" OR sel$ = CHR$(27) IF sel$ = CHR$(27) THEN sel$ = "N" SCREEN 9, 0, 1, 0 END SUB SUB SAVEFILE erry = 23: errx = 31 cursor$ = "_": curdelay = 10 prfile$ = file$ DO LOCATE 23, 28: PRINT STRING$(24, " ") sel$ = INKEY$ SELECT CASE UCASE$(sel$) CASE "A" TO "Z", "\", "/", ":", "0" TO "9" IF LEN(file$) < 18 THEN file$ = file$ + sel$ CASE CHR$(8) IF LEN(file$) > 0 THEN file$ = LEFT$(file$, LEN(file$) - 1) CASE CHR$(13) save$ = "yes": EXIT DO CASE CHR$(27) save$ = "no": file$ = prfile$: EXIT DO END SELECT IF LEN(file$) = 18 THEN cursor$ = " " LOCATE 23, 28: COLOR 4: PRINT "SAVE: "; file$ + cursor$ CALL CURCHANGE PCOPY 1, 0 LOOP ffile$ = file$ + ".gph" IF save$ = "yes" THEN GET (490 + xdim1, 240 + ydim1)-(490 + xdim2, 240 + ydim2), image DEF SEG = VARSEG(image(0)) IF (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) <= 100 THEN BSAVE ffile$, VARPTR(image(0)), 84 ELSE BSAVE ffile$, VARPTR(image(0)), 244 END IF END IF LOCATE 23, 28: PRINT STRING$(24, " ") IF cutshort$ = "yes" THEN file$ = prfile$: cutshort$ = "no" END SUB SUB SCREENSET file$ = "c:\" box = 2: col = 0 ycursor = 100 + ydim1 * 10: xcursor1 = 70: xcursor2 = 210 + xdim1 * 10 SCREEN 9, 0, 1, 0: CLS x = 70: y = 34 FOR num = 0 TO 15 LINE (x, y)-(x + 30, y + 30), 4, B LINE (x + 2, y + 2)-(x + 28, y + 28), num, BF x = x + 30: IF x = 550 THEN x = 70: y = y + 15 NEXT x = 210: y = 100 FOR num = 1 TO 400 pcol(num) = 0 LINE (x, y)-(x + 10, y + 10), 4, B x = x + 10: IF x = 410 THEN y = y + 10: x = 210 NEXT COLOR 12 LOCATE 1, 30: PRINT "*** QB IMAGE DRAW ***" LOCATE 25, 3: PRINT "NEW OPEN SAVE ROTATE COLOR CONVERT SPRAY SCROLL DIM ANIMATE QUIT"; COLOR 10 LOCATE 25, 3: PRINT "N"; : LOCATE 25, 8: PRINT "O"; LOCATE 25, 14: PRINT "S"; : LOCATE 25, 20: PRINT "R"; LOCATE 25, 28: PRINT "C"; : LOCATE 25, 38: PRINT "V"; LOCATE 25, 45: PRINT "P"; : LOCATE 25, 55: PRINT "L"; LOCATE 25, 59: PRINT "D"; : LOCATE 25, 64: PRINT "A"; LOCATE 25, 73: PRINT "Q"; COLOR 4 IF xdim1 <> ydim1 OR xdim2 <> ydim2 THEN COLOR 1: LOCATE 25, 20: PRINT "R"; : COLOR 2: PRINT "OTATE"; LINE (475, 125)-(524, 174), 10, B LINE (480, 130)-(519, 169), 10, B: PAINT (476, 126), 10, 10 LINE (480, 130)-(519, 169), 4, B LINE (485, 135)-(514, 164), 4, B: PAINT (481, 131), 4, 4 LINE (475, 225)-(524, 274), 10, B LINE (480, 230)-(519, 269), 10, B: PAINT (476, 226), 10, 10 LINE (480, 230)-(519, 269), 4, B LINE (485, 235)-(514, 264), 4, B: PAINT (481, 231), 4, 4 LINE (75, 175)-(124, 224), 10, B LINE (80, 180)-(119, 219), 10, B: PAINT (76, 176), 10, 10 LINE (80, 180)-(119, 219), 4, B LINE (85, 185)-(114, 214), 4, B: PAINT (81, 186), 4, 4 END SUB SUB SCROLL LOCATE 23, 30: PRINT "PRESS ESC WHEN DONE" DO xmove = 0: ymove = 0 DO sel$ = INKEY$ SELECT CASE sel$ CASE CHR$(0) + CHR$(72) ymove = -10 CASE CHR$(0) + CHR$(80) ymove = 10 CASE CHR$(0) + CHR$(75) xmove = -10 CASE CHR$(0) + CHR$(77) xmove = 10 CASE CHR$(27) CASE ELSE sel$ = "" END SELECT PCOPY 1, 0 LOOP UNTIL sel$ <> "" IF sel$ = CHR$(27) THEN EXIT DO x = 210 + xdim1 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) pcol(num) = POINT(x + 2, y + 2) LINE (x + 2, y + 2)-(x + 8, y + 8), 0, BF PSET (x / 10 + 469, y / 10 + 230), 0 x = x + 10: IF x = 220 + xdim2 * 10 THEN y = y + 10: x = 210 + xdim1 * 10 NEXT x = 210 + xdim1 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) IF x + xmove >= 210 + xdim1 * 10 AND x + xmove <= 210 + xdim2 * 10 AND y + ymove >= 100 + ydim1 * 10 AND y + ymove <= 100 + ydim2 * 10 THEN LINE (x + 2 + xmove, y + 2 + ymove)-(x + 8 + xmove, y + 8 + ymove), pcol(num), BF PSET (x / 10 + 469 + xmove / 10, y / 10 + 230 + ymove / 10), pcol(num) END IF x = x + 10: IF x = 220 + xdim2 * 10 THEN x = 210 + xdim1 * 10: y = y + 10 NEXT LOOP LOCATE 23, 30: PRINT STRING$(24, " ") END SUB SUB SPRAY DO LOCATE 23, 37: PRINT STRING$(20, " ") IF intense < 11 THEN text$ = "0#" IF intense > 10 THEN text$ = "##" LOCATE 23, 37: PRINT "SOFT: "; : PRINT USING text$; intense - 1 sel$ = INKEY$ SELECT CASE sel$ CASE CHR$(0) + CHR$(72) intense = intense + 1: IF intense > 21 THEN intense = 21 CASE CHR$(0) + CHR$(80) intense = intense - 1: IF intense < 2 THEN intense = 2 CASE CHR$(27) LOCATE 23, 37: PRINT STRING$(20, " ") EXIT SUB END SELECT PCOPY 1, 0 LOOP UNTIL sel$ = CHR$(13) LOCATE 23, 37: PRINT STRING$(20, " ") x = 210 + xdim1 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) pcol(num) = POINT(x + 2, y + 2) x = x + 10: IF x = 220 + xdim2 * 10 THEN x = 210 + xdim1 * 10: y = y + 10 NEXT FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) rnum = INT(RND * intense) IF rnum = 0 THEN pcol(num) = col NEXT x = 210 + xdim1 * 10: y = 100 + ydim1 * 10 FOR num = 1 TO (xdim2 - xdim1 + 1) * (ydim2 - ydim1 + 1) LINE (x + 2, y + 2)-(x + 8, y + 8), pcol(num), BF PSET (x / 10 + 469, y / 10 + 230), pcol(num) x = x + 10: IF x = 220 + xdim2 * 10 THEN x = 210 + xdim1 * 10: y = y + 10 NEXT END SUB