 Home ACAD Computer Studies Graphical Knot Making Photoshop Sudoku

# The Qbasic coordinate system

• The upper left-hand corner of the screen in all of the screen modes is (0,0).
• The following are the pixels for Screen 7&13 (which are 320 pixels) and Screen 12 (which is 640 pixels)  • There are 3 ways to do graphics using Qbasic commands:
• Circle: (To draw a circle, you have to Plot one point, the center point, and then give it a radius and an optional color)
• Example : CIRCLE (YLOCATION, XLOCATION), RADIUS LENGTH, COLOR
• Line: (To put a line on the screen, you must graph two points: the start, and the end.)
• Example : LINE (YLOCATION1, XLOCATION1)-(YLOCATION2, XLOCATION2), COLOR
• Box: (To put a box on the screen, you do the same thing as a line, but the two points are the top left-hand corner, and the bottom right-hand corner.)
• Example : LINE (TOPLEFTY, TOPLEFTX)-(BOTTOMRIGHTY, BOTTOMRIGHTX), COLOR, B
• We can change the B (for box) with BF (for box filled)

The color is a numeric value from 0 to 15 if you are in SCREEN 7 graphics mode, or 0 to 255 if you are in SCREEN 13 graphics mode. WARNING: YOU MUST PUT THE GRAPHICS MODE AT THE TOP FOR GRAPHICS TO WORK. Here are the colors:

1. : Black
2. : Blue
3. : Green
4. : Cyan
5. : Red
6. : Purple
7. : Brown (kind of)
8. : Light Gray (Low Intensity White)
9. : Dark Gray
10. : Light Blue
11. : Light Green
12. : Light Cyan
13. : Light Red
14. : Light Purple
15. : Yellow
16. : White (High Intensity White)

Program 1 SCREEN 13 LINE (50, 50)-(100, 100), 45 CIRCLE (50, 50), 12, 66 CIRCLE (50, 100), 12, 122

Program 2 SCREEN 13 FOR x = 1 TO 320 STEP 10 LINE (x, 50)-(100, 100), 45 CIRCLE (x, 50), x, 66 CIRCLE (x, 100), 12, 122 NEXT x

Program 3 SCREEN 13 FOR x = 1 TO 320 STEP 10 For y = 1 to 200 step 10 LINE (x, 50)-(100, 100), 45 CIRCLE (x, 50), x, 66 CIRCLE (x, 100), 12, 122 Next y NEXT x

Program 4 SCREEN 13 FOR x = 1 TO 150 STEP 5 FOR y = 1 TO 200 STEP 10 LINE (x, 20)-(x, y), x CIRCLE (110, 100), x, x SLEEP 1 NEXT y NEXT x  