|AÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» |Aº |2Happy Hacker |AºÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ^1Auto Draw |AÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͺ |2Happy Hacker |Aº |AÈÍÍÍÍÍÍÍÍÍÍÍÍÍͼÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÈÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ^Cby ^CDavid Leithauser Auto Draw is a graphics program that lets you draw pictures on your computer screen. There are many such programs available, but Auto Draw has two important differences from these other programs. First, Auto Draw lets you draw by inputting commands, such as "D20" to draw a line down 20 units, rather than draw by moving a cursor around the screen with the cursor keys. This makes it useful for drawing precise figures in such applications as drafting, where you are drawing a diagram to specifications. Second, when you have finished drawing the picture on the screen, Auto Draw will write a short BASIC program for you that draws this picture. The BASIC program is completely independent of Auto Draw, and can be used as a stand alone program or a subroutine in a larger program like a graphic adventure game. Therefore, you can use Auto Draw as a programming aid. ^CUsing Auto Draw When you run Auto Draw, it will first display a color chart and ask you which color you want as the background color for your drawing. Type the number of your selection (from 1 to 16) and press ENTER (or RETURN on some computers). Next the computer will ask which palette you want. Press either 0 or 1. You do not need to press ENTER. Auto Draw will then show you the three colors you will be using (not counting background) with a number above each color, and ask you which color to start with. This is the color that Auto Draw will use when you first start drawing. You can change colors as you draw (more on this shortly), but for now just select the color you want your first line to be. Remember the numbers above each of the colors, since you will be using these numbers to refer to the colors later. Once you select your starting color, the screen will clear except for a tiny flashing cursor in the center of the screen. You are now ready to input your commands by typing them on the keyboard. As you type the command it will appear in the upper left corner of the screen. If you make a mistake, press the backspace key. When you finish the command, press ENTER. Your primary commands are U for up, D for down, R for right, and L for left. Each of these should be followed by a number. For example, you would type U10 to draw a line up 10 units. You can draw a line at any angle by combining these commands. For example, R20D40 (or D40R20) causes Auto Draw to draw a diagonal line right 20 and down 40. If you omit the first number it defaults to the second number. For example, UR40 (or RU40) causes Auto Draw to draw a line that goes up 40 and to the right 40. You must, however, provide at least one number. You can move the cursor without drawing a line by putting M before any of the above commands. For example, MLU40 causes the cursor to move left and up 40, but not draw a line as it moves. This allows you to draw several figures that are not connected. You can change drawing color by inputting C followed by a number from 0 to 3 as a command. For example, if you have been drawing with color 1 and you input the command C2, the commands that follow will draw with color 2, until you input another C command. When you input a C command, you will not see any effect on the screen until you execute the next drawing command. You can fill in an area that is bordered by one color with the P command. If the border is the same color as the color you are filling it with, the command is just Pn, where n is the number from 0 to 3 to fill with. If the border is a different color than the fill color, the command is Pn,m (such as P2,3), where n is the fill color and m is the border color. To use the P command, you must first move the cursor inside the area to be filled with an M (move without drawing) command, such as MUR5. The P command changes the current color to color n. That is, after a Pn or Pn,m command, the program will draw in color n until the next C command. The most complicated draw command is the CIRCLE command. This command is in the form CIRCLE a,b,c,d, where a is the radius, b is the starting point, c is the end point, and d is the ratio of the height of the circle to the width. The variables b and c are in degrees and vary from 0 to 360. The right side of the circle is 0 degrees and the left side is 180 degrees. For example, a circle that starts at 90 and ends at 270 would be the left side of a circle. Fortunately, all these values except the radius have default values. You will normally just use the command in the form CIRCLE a. For example, CIRCLE 40 draws a circle of radius 40, centered at the current cursor position. You can draw an ellipse by specifying just the radius and the Y/X ratio. For example, CIRCLE 60,,,.2 and CIRCLE 60,,,5 draw ellipses. The starting point defaults to 0 degrees and the ending point defaults to 360. The Y/X ratio defaults to 1. Pressing the Esc key erases the last operation you performed. If you draw a line (or perform some other operation) and you don't like it, just press the Esc key. You can press the Esc key repeatedly to erase any number of previous operations, in the reverse order in which they were performed. For example, pressing the Esc key five times erases the last five operations. If you are drawing very complicated pictures, you may notice that the computer seems to respond more and more slowly to your commands. This is because Auto Draw draws the entire picture from the start each time you add or remove a line. Please wait for the computer to add each new line before inputting a new command, to prevent the computer from becoming backlogged. You can move the picture around the screen with the cursor keys. This allows you to reposition the picture if you find that you are running out of room at one side or the top or bottom. You can enlarge the picture on the screen by pressing the plus (+) key. You can reduce it by pressing the minus (-) key. The picture is fully reduced when the program starts, so pressing the - key will have no effect until you have pressed the + key at least once. Pressing S allows you to save the current drawing on disk. Auto Draw will ask you to input a file name. Input any name up to eight letters and press ENTER. Auto Draw will save the picture on disk with that file name. This is not the stand-alone BASIC program I mentioned. I will discuss that shortly. This file is a data file that allows Auto Draw to recreate the picture. You can recall the picture later by pressing G when the program is running and inputting the same file name when Auto Draw asks for a file name. Pressing E totally erases the current picture, giving you a blank slate. Pressing T terminates the program completely. Auto Draw will give you a chance to save the picture before doing either of these, unless you have saved the picture since you last altered it. Pressing B causes Auto Draw to write a BASIC program which draws the picture currently on the screen. When you press B, Auto Draw will ask whether you want the BASIC program output to the screen, printer (line printer # 1), or disk. If you choose the screen or printer, Auto Draw outputs a listing of the program. If you choose disk, Auto Draw will ask you for a file name. Input any name up to eight letters and press ENTER. Auto Draw will then save the actual program on disk with that file name and the extension BAS. After Auto Draw has saved the program on disk, you can go to BASIC and load and run the program. The first line of the program sets the screen to graphics mode. The second line positions the picture on the screen the same way it was when Auto Draw created the program. The rest of the lines draw the picture. After the program has drawn the picture, it returns to BASIC and displays the OK prompt. If all you want the program to do is draw the picture, you will probably want to add a line such as 60000 GOTO 60000 to cause the program to loop back until you press the Ctrl-BREAK key. This prevents the screen from showing the OK prompt. You can also renumber the BASIC program lines that draw the picture and use them as a subroutine in a program, such as a graphics adventure game. While running Auto Draw, you can get a brief summary of all the commands by pressing either ? or H (for Help). To run this program outside the BIG BLUE DISK menu, type: ^1AUTODRAW^0. DISK FILES THIS PROGRAM USES: ^FAUTODRAW.EXE ^FBRUN30.EXE ^FRETURN30.EXE