Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 115 - 2505_CoreGPT(Podar)_Flipbook_C7
P. 115

    Syntax:

                     CLS
                     Use this when you want to clear any text printed on the text output screen.

                     The CLG command clears the graphics output window (removes shapes, drawings, colors, etc.).
                     Syntax:

                     CLG
                     Use this when you want to clear any graphics displayed on the graphics output screen.

                     2.  PLOT (Draw a Dot)
                     The PLOT command is used to place a single dot on the graphics window at specified coordinates.

                     Syntax:

                     PLOT x, y
                         ✶  x: The horizontal coordinate (x-axis).

                         ✶  y: The vertical coordinate (y-axis).

                     Program 1:  To draw a Dot.

                     CLS

                     PLOT 100, 200
                     This clears the screen and places a dot at the coordinates (100, 200) on the graphics window.

                     By default, the graphics window is 512 × 512 pixels. You can use the CLS command to clear the
                     screen and the PLOT command to place a dot at any position within the window.
                     Understanding Coordinates

                     In the graphics window, coordinates are used to specify positions for drawing. The coordinate
                     system works as follows:
                         ✶  The top-left corner of the graphics window is at the coordinate (0, 0).

                         ✶  The x-axis increases from left to right.
                         ✶  The y-axis increases from top to bottom.

                     Program 2: To draw dots at the four corners of the window.

                     CLS
                     PLOT 0, 0
                     PLOT 511, 0

                     PLOT 0, 511
                     PLOT 511, 511

                     This program places four dots at each of the corners of the graphics window, showing how
                     coordinates work in the graphics window.

                                                                                             Graphics in BASIC-256      113

| 110 111 112 113 114 115 116 117 118 119 120 |