Zeichnen - Programm unter QBASIC
Cls f = 1 Screen 12 x = 200: y = 300 Cls Print "Zeichnen sie mit den Cursor - Richtungstasten" Print "Stift hoch f10" Print "Kreis f1" Print "Linie f2" Print "Rechteck f3" Print "Farbe f4" Print "Bereich speichern f5" Print "Bereich laden f6" Line (150, 130)-(600, 300), 1, B LOCATE 24, 20 Print "Programmende mit der ESC - Taste" Do If 150 < x < 600 And 300 < y < 130 Then Select Case c Case 0: PSet (y, x), f LOCATE 24, 21 CASE 1: INPUT "Radius"; i: CIRCLE (b, a), i, f: c = 0: GOTO e e: If d3 = 1 Then Circle (b, a), i, f, , , 2: Circle (b, a), i, f, , , 0.5: Circle (b, a), i, f, , , 0.25: Circle (b, a), i, f, , , 4 End If Case 2: PSet (y, x), f: For u = 1 To 1000: Next u: PSet (y, x), 0 Case 3: PSet (y, x), f: For u = 1 To 1000: Next u: PSet (y, x), 0 Case 5: PSet (y, x), f: For u = 1 To 1000: Next u: PSet (y, x), 0 Case 12: Line (y, x)-(b, a), f: c = 0 Case 13: Line (y, x)-(b, a), f, B: c = 0: GoTo f f: If d3 = 1 Then Line (y, a)-(y + 20, a - 20), f: Line (b, a)-(b + 20, a - 20), f: Line (y + 20, a - 20)-(b + 20, a - 20), f: Line (b, x)-(b + 20, x - 20), f: Line (b + 20, x - 20)-(b + 20, a - 20), f: Line (y + 20, a - 20)-(b + 20, a - 20), f: Line (b, a)-(b + 20, a - 20), f: Line (b + 20, a - 20)-(b + 20, y - 20), f End If End Select End If Do Key$ = INKEY$ Loop Until Len(Key$) Select Case Asc(Right$(Key$, 1)) Case 72: x = x - 1 Case 80: x = x + 1 Case 77: y = y + 1 Case 75: y = y - 1 Case 59: c = 1: a = x: b = y Case 13: c = c + 10 Case 68: c = 5 Case 67: c = 0 Case 60: c = 2: a = x: b = y Case 61: c = 3: a = x: b = y CASE 62: INPUT "Farbe (1-9)"; f CASE 63: INPUT "x und y- Wert des speicherns", x, y: DIM e%(1 TO 50 * 70): GET (x, y)-(x + 50, y + 70), e% CASE 64: PUT (150, 300), e%, XOR Case 65: d3 = 1 Case 66: d1 = 0 Case 27: Exit Do End Select Loop End