Page 129 - Learn to Program - Basic-256
P. 129

Chapter 9: Custom Graphics – Creating Your Own Shapes.                          Page 113


                   screen.


                   Let's draw an equilateral triangle (all sides are the same length) on a piece of
                   paper. Put the point (0,0) at the top and make each leg 10 units long (see
                   Illustration 19).
































            Illustration 19: Equilateral Triangle





                   Now we will create a program, using the simplest form of the stamp
                   statement, to fill the screen with triangles. Program 51 Will do just that. It
                   uses the triangle stamp inside two nested loops to fill the screen.



                1       # stamptriangle.kbs - use a stamp to draw many
                        triangles
                2
                3       clg
                4       color black



                                                           © 2019 James M. Reneau (CC BY-NC-SA 3.0 US)
   124   125   126   127   128   129   130   131   132   133   134