Plotting Made Easy
John Scarborough
This utility lets you draw a figure on any graphics screen with a joystick. It will then convert it into a series of PLOT, DRAWTO statements which are automatically entered into the program. A real time-saver – you may never need graph paper again!
If you've ever tried to PLOT and DRAWTO your way through some complex or even simple figure in one of the graphics modes, then you know how time consuming it is. So why not have the computer do it for you? This program allows you to first draw your figure on the screen using a joystick, and then have the computer do the PLOTs and DRAWTOs for you.
Enter the program into your computer carefully. Don't try to shorten it, or you're sure to get confused. I "squeezed" the program to get as much free RAM as I could. If you still need more, you can get rid of some lines from 603 on up. You don't want to go any higher than 523. Just make sure that L = 650 on the last one you leave in. Before you use the program, it'll be useful to make a couple of back-up copies.
The following steps show you how to make a box with an x in it (at first glance it might look long and confusing, but once you get the hang of it you'll be able to move quickly).
- Choose the graphics mode you want (I suggest you practice on mode 3 until you get the feel of what you're doing).
- Choose the cursor color.
- Choose the cursor luminance (7 will give a nice shade).
- Choose the background color.
- Move the cursor to a starting point and draw the box (press the joystick button to draw).
- Position the cursor in one of the corners (corner 1), and then hit "P" (you are PLOTting your first line).
- Move to the next corner (it doesn't matter how you get there), and hit "D." You just had the computer PLOT and DRAWTO for you.
- For the second line : Stay in corner 2, and hit "P." Move to the third corner and hit "D."
- Follow the same procedure until you get back to the first corner.
- After you end your fourth line, start another one (by pressing "P"). Move to the diagonal corner (line not needed), and end the line.
- Do the same with the other two corners.
- Hit the ESCape key.
- You'll briefly see some program statements being entered into the program; then you'll be in the graphics mode.
- You should have your box with the X in it.
Lines 700-898 are saved for your PLOT-DRAWTO statements. You can LIST them at any time, but don't run it to get back to the drawing. Enter "G.4000" instead. You will find that the cursor moves very slowly in mode 8. If you can't handle the slowness then hit "F." You'll have to slow it back down (by pressing "S") when you want to PLOT. If you want to start a new figure or drawing you'll have to take out lines 700-898. Just make sure line 700 reads: 700 RETURN. A faster way to take out the lines would be to have the computer print out the line numbers for you. Then you press RETURN after each line. Example: 5000 FOR X = 701 TO 721 : ?X : NEXT X. If your figure consumed a lot of lines it might be faster just to CLOAD your fresh program from tape.
PROGRAM. Plotting Made Easy.
1 REM PLOTTING MADE EASY 2 REM BY JOHN SCARBOROUGH 3 DIM AN$(1) : LI = 699 : GRAPHICS 0 : SETCOLOR 2, 0, 0 : ? : ? : ? "GRAPHICS MODE(3 TO 8)"; : INPUT MODE : IF MODE = 8 THEN 5 4 ? : ? "CURSOR COLOR(0 TO 14)"; : INPUT CC : ? : ? "CURSOR LUMINENCE(0 TO 14)"; : INPUT CL 5 ? : ? "BACKGROUND COLOR(YES OR NO)"; : INPUT AN$ : IF AN$ = "N" THEN 7 6 ? : ? "BACKGROUND COLOR(0 TO 14)"; : INPUT BC : ? : ? "BACKGROUND LUMINENCE(0 TO 14)"; : INPUT BL 7 IF MODE = 8 THEN HRNG = 319 : VRNG = 191 8 IF MODE = 6 OR MODE = 7 THEN HRNG = 159 : VRNG = 95 9 IF MODE = 4 OR MODE = 5 THEN HRNG = 79 : VRNG = 47 11 IF MODE = 3 THEN HRNG = 38 : VRNG = 23 14 GRAPHICS MODE : SETCOLOR 2, BC, BL : SETCOLOR O, CC, CL : SETCOLOR 4, BC, BL : COLOR 1 : POKE 752, 1 : L = 500 : GOSUB 700 17 ? "HORIZONTAL - " : ? "VERTICAL - " 20 GOSUB 100 : IF STRIG(0) = 0 THEN PLOT H, V : GOTO 20 30 PLOT H, V : FOR X = 1 TO 5 : NEXT X : POSITION H, V : ? #6; " " : GOTO 20 100 S = STICK(O) : IF S = 11 THEN H = H - 1 105 IF S = 5 THEN H = H + 1 : V = V + 1 110 IF S = 7 THEN H = H + 1 115 IF S = 6 THEN H = H + 1 : V = V - 1 120 IF S = 14 THEN V = V - 1 130 IF S = 13 THEN V = V + 1 135 IF S = 9 THEN H = H - 1 : V = V + 1 140 IF S = 10 THEN H = H - 1 : V = V - 1 141 IF H < 0 THEN H = 0 142 IF H > HRNG THEN H = HRNG 143 IF V > VRNG THEN V = VRNG 150 IF V < 0 THEN V = 0 155 IF MM = 0 THEN POKE 656, 0 : POKE 657, 19 : ? "FREE MEMORY - ";FRE(0) : MM = 1 160 IF PEEK(764) = 56 THEN GOSUB 2000 : POKE 656, 2 : ? "FAST(SLOW DOWN TO PLOT OR DRAWTO)" : FT = 1 : GOSUB 440 165 IF PEEK(764) = 62 OR OK = 0 THEN GOSUB 2000 : POKE 656, 2 : ? " **** PLOTTING MADE EASY **** {3 SPACES}" : FT = 0 : GOSUB 440 : OK = 1 170 IF FT = 1 THEN RETURN 180 IF PEEK(764) = 10 THEN GOSUB 2000 : POKE 656, 1 : POKE 657, 19 : ? "PLOT "; H; ","; V; "{3 SPACES}" : GOSUB L : GOSUB 440 185 IF PEEK(764) = 28 THEN 1010 190 IF PEEK(764) = 58 THEN GOSUB 2000 : POKE 656, 1 : POKE 657, 19 : ? "DRAWTO "; H; ","; V; "{3 SPACES}" : GOSUB L : GOSUB 440 210 POKE 656, 0 : POKE 657, 13 : ? H;" " 230 POKE 657, 11 : ? V; " " 300 RETURN 440 POKE 764, 255 : RETURN 500 L = 503 : A = H : B = V : RETURN 503 L = 510 : C = H : D = V : RETURN 510 L = 513 : E = H : F = V : RETURN 513 L = 520 : G = H : I = V : RETURN 520 L = 523 : J = H : K = V : RETURN 523 L = 530 : M = H : N = V : RETURN 530 L = 533 : O = H : P = V : RETURN 533 L = 540 : Q = H : R = V : RETURN 540 L = 543 : SS = H : T = V : RETURN 543 L = 550 : U = H : W = V : RETURN 550 L = 553 : Y = H : Z = V : RETURN 553 L = 560 : AA = H : AB = V : RETURN 560 L = 563 : AC = H : AD = V : RETURN 563 L = 570 : AE = H : AF = V : RETURN 570 L = 573 : AG = H : AH = V : RETURN 573 L = 580 : AI = H : AJ = V : RETURN 580 L = 583 : AK = H : AL = V : RETURN 583 L = 590 : AM = H : AN = V : RETURN 590 L = 593 : AO = H : AP = V : RETURN 593 L = 600 : AQ = H : AR = V : RETURN 600 L = 603 : AS = H : AT = V : RETURN 603 L = 650 : AU = H : AV = V : RETURN 650 GOTO 1010 700 RETURN 899 RETURN 950 IF DD = 0 AND EE = 0 AND FF = 0 AND GG = 0 THEN RETURN 951 LI = LI + 1 : ? LI; "PL."; DD; " , "; EE; ": DR."; FF; ","; GG : RETURN 1010 GRAPHICS 0 : ? : ? : ? 1015 DD = A : EE = B : FF = C : GG = D : GOSUB 950 : DD = E : EE = F : FF = G : GG = I : GOSUB 950 : DD = J : EE = K : FF = M : GG = N : GOSUB 950 1020 DD = O : EE = P : FF = Q : GG = R : GOSUB 950 : DD = SS : EE = T : FF = U : GG = W : GOSUB 950 : DD = Y : EE = Z : FF = AA : GG = AB : GOSUB 950 1030 DD = AC : EE = AD : FF = AE : GG = AF : GOSUB 950 : DD = AG : EE = AH : FF = AI : GG = AJ : GOSUB 950 : DD = AK : EE = AL : FF = AM : GG = AN : GOSUB 950 1040 DD = AO : EE = AP : FF = AQ : GG = AR : GOSUB 950 : DD = AS : EE = AT : FF = AU : GG = AV : GOSUB 950 : ? "G.4000" 1100 POSITION 0, 0 : POKE 842, 13 : END 2000 SOUND 0, 17, 10, 10 : FOR X = 1 TO 7 : NEXT X : SO UND 0, 0, 0, 0 : RETURN 4000 A = 0 : B = 0 : C = 0 : D = 0 : E = 0 : F = 0 : G = 0 : I = 0 : J = 0 : K = 0 : M = 0 : N = 0 : O = 0 : P = 0 : Q = 0 : R = 0 : SS = 0 : T = 0 : U = 0 : W = 0 4001 Y = 0 : Z = 0 : AA = 0 : AB = 0 : AC = 0 : AD = 0 : AE = 0 : AF = 0 : AG = 0 : AH = 0 : AI = 0 : AJ = 0 : AK = 0 : AL = 0 : AM = 0 : AN = 0 : AO = 0 : AP = 0 : POKE 842, 12 4002 AQ = 0 : AR = 0 : AS = 0 : AT = 0 : AU = 0 : AV = 0 : LI = LI + 1 : M M = 0 : OK = 0 : GOTO 14
Return to Table of Contents | Previous Section | Next Section