none
Newbie Small Basic poster

Answers

  • Yes, click on the button "publish". Your program gets a name consisting of three letters and three digits e.g. ABC123.

    If you publish that code here, others can import your program. Give also an explanation of the purpose of the program.

    If you have a program wich gives errors you can also publish in a posting on the forun, with questions for help.

    Read some other topics and you will see how this goes. See e.g. the montly challenge 

    https://social.msdn.microsoft.com/Forums/en-US/dae04eac-4e52-449c-b2fe-03de9ca7520a/challenge-of-the-month-april-2017?forum=smallbasic#136dd79e-fa72-4181-bd79-9915bdf407ec

    Jan [ WhTurner ] The Netherlands




    Thursday, April 13, 2017 8:24 AM
    Answerer

All replies

  • Yes, click on the button "publish". Your program gets a name consisting of three letters and three digits e.g. ABC123.

    If you publish that code here, others can import your program. Give also an explanation of the purpose of the program.

    If you have a program wich gives errors you can also publish in a posting on the forun, with questions for help.

    Read some other topics and you will see how this goes. See e.g. the montly challenge 

    https://social.msdn.microsoft.com/Forums/en-US/dae04eac-4e52-449c-b2fe-03de9ca7520a/challenge-of-the-month-april-2017?forum=smallbasic#136dd79e-fa72-4181-bd79-9915bdf407ec

    Jan [ WhTurner ] The Netherlands




    Thursday, April 13, 2017 8:24 AM
    Answerer
  • Thanks Jan.  Here goes.

    Below some code to draw a 'Flower of Life' and so named.

    '
    '   Flower of Life
    '   2017 H. Wilson Scholz
    '   Open source to use
    '  
    '
    GraphicsWindow.Title = "Flower of Life"
    GraphicsWindow.Width = 800
    GraphicsWindow.Height = 640
    GraphicsWindow.BackgroundColor = "Black" 
    Constant = Math.Sin(Math.pi/3) '  Sin of 60 degrees ( in radians )
    GraphicsWindow.PenWidth = 1  ' narrow pen width
    GraphicsWindow.PenColor=" Yellow "  ' Yellow chosen, any bright color can be used
              '   Draw the inclosing circle
    GraphicsWindow.DrawEllipse(140, (86.6 * Constant), 500, 500)
    X1 = 240  '  Start of ellipse X axis
    X2 = 440  '  End of X axis increment on this Y axis
    R = 255   ' Color Red intensity
    G = 0     ' Color Green intensity
    B = 0     ' Color Blue intensity
    S = 50    '  Step value for X axis
    W = 25    '  Increment and decrement value For X axis
    C = 0     '  Start of increment multiplier value for Y axis
    Y = 100   '  Starting value for Y axis
              '  Draw circles on the first of the Y axes
    For Z = 1 To 9
      For X = X1 To X2 Step S
        ' Change Pen Color based upon variables ( R & B )
        GraphicsWindow.PenColor=GraphicsWindow.GetColorFromRGB(R,G,B)
        R = R - 5
        B = B + 4
        GraphicsWindow.DrawEllipse(x, Y, 100, 100)
    EndFor    '  Step through values of X for each circle on current Y axis
              '  Decrement x1,  increment x2
    X1 = X1 - W
    X2 = X2 + W
    If X1 <= 140 Then
              '  Decrement X2 and increment X1
      W = - W
    EndIf
              '  Increment value of Y by 50 multiplied by value of the Sin of 60 degrees
      C = C + 1
      Y = 100 + (( C * 50 ) * Constant )
      EndFor  '  End incrementing the value of Z
     

    Tuesday, April 18, 2017 9:51 PM