none
Challenge of the Month - September 2018 RRS feed

  • General discussion

  • These challenges are intended for people who are learning to program for the first time or for those returning to programming who want to start using Small Basic.  Some will be easy, some will be hard - but they will all make you think, and more importantly be GREAT FUN!

    Please post your solutions / partial solutions / questions / feedback etc. into this thread that will remain 'sticky' for the month.  The only rule is that your solution must use standard Small Basic methods (no extensions).

    It would be good if people could post their problems with these challenges so that a discussion can start so that everyone can learn from each other.

    We may extend these challenges over into a second month if solutions and questions are still coming in.

    Graphics Challenges 1

    For these challenges DON'T use the Shapes or Controls methods:

    1] Draw an ellipse with the turtle.

    2] Draw a filled ellispse with the turtle.

    3] Draw a button with mouse over that changes the button color, and mouse click events.

    Graphics Challenges 2

    Using any Small Basic methods:

    1] Make a textbox that copies the text typed in it to the GrapicsWindow and resets the textbox to be blank when Return is pressed.

    2] Draw a snail shell, starfish or anemone.

    Text Challenge

    1] Use the TextWindow to input a number and say if it is odd or even.

    2] Use the TextWindow to input the user's name and then hold a simple conservation, asking questions.  Try to use the user replies to adapt the consersation.

    For eample:

    What is you name?

    Fred

    Hello Fred, what is your favorite color?

    red

    I saw a red ballon today.  Do you have any red clothes?

    ...

    Physics challenge

    1] Make a Newton's cradle.

    Do you have an idea or a future challenge? Please post it here!

    Saturday, September 1, 2018 8:26 AM
    Moderator

All replies

  • Hi All,

    This is My solution for 1st one of Text challenges = CMV507

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Sunday, September 2, 2018 6:16 AM
  • Hi All,

    This is my solution for 2nd one of Text Challenges = FZB819

    This is a simple 10 - liner code.

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Sunday, September 2, 2018 6:32 AM
  • Hi All,

    This is my solution for 1st one of Graphics Challenges 1. Import code = DQB178

    Thanks


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Sunday, September 2, 2018 6:39 AM
  • Hi all.This is my solution for 2nd one of Graphics challenges 2.

    Import code = MRK453

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Sunday, September 2, 2018 6:51 AM
  • Blinkig Eyes Cartoon-Ninja 4 ID HDM234                                        
                                                                                                                mahreen miangul
    Monday, September 3, 2018 4:58 AM
  • Graphics Challenges 2    RBQ131

    Draw a snail shell

    Monday, September 3, 2018 12:08 PM
    Answerer
  • This is my solution for the challenge to draw a snail shell: JVT152.

    Screen shot of a program Snail Shell


    Nonki Takahashi


    Monday, September 3, 2018 1:07 PM
    Moderator
  • Hi all.This is my solution for 2nd one of Graphics challenges 2.

    Import code = MRK453

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Roshan, nice art!

    Screen shot of a program MRK453


    Nonki Takahashi

    Monday, September 3, 2018 1:58 PM
    Moderator
  • This is my solution for the challenge to draw a starfish: NHJ324.

    Screen shot of a program Starfish


    Nonki Takahashi

    Monday, September 3, 2018 2:02 PM
    Moderator
  • This is my solution for the challenge to draw an anemone: ZFK355.

    Screen shot of a program Anemone


    Nonki Takahashi

    Monday, September 3, 2018 2:54 PM
    Moderator
  • Hi All,

    This is my solution for 1st one of Graphics Challenges 1. Import code = DQB178

    Thanks


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#


    Great, can you do an ellipse as well as circle - a bit trickier.
    Monday, September 3, 2018 10:07 PM
    Moderator
  • Hi litdev,

    I made an ellipse as well as circle , but the turtle takes nearly 2 minutes to complete the drawing though I added Turtle.Speed = 10.

    Code = RCR541

    If there should not be any gap between lines then, 12th line should be changed to

    length = length - 5.

    Which will give the result as (it will take a lot of time)

    Thanks.


    Roshan - 8th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#




    Tuesday, September 4, 2018 12:38 PM
  • My attempt at filled ellipse (not using trig angles).  This was a toughy and quite slow.

    Import FSZ918.

    And a slightly faster version, NXW906.
    Tuesday, September 4, 2018 7:08 PM
    Moderator
  • Turtle Ellipse(s) filled (with lines). ID: BHN895


    Wednesday, September 5, 2018 9:45 AM
    Answerer
  • to speedup turtle 5x, don't use turtle but use fast turtle replacement: LDMath.Convert2Cartesian

    if u don't want to use ld xtension then u use classic math procedure:

    x =x0+ r × cos( θ )

    y = y0+r × sin( θ )

    where:

    r=turtle distance to cross

    theta ( θ)= (turtle angle-90)*math.pi/180

    x0, y0=turtle positions

    then just use graphicwindow.drawline(x y x0 y0)

    afterward

    x0=x

    y0=y

    • Edited by Tryhest Wednesday, September 5, 2018 10:17 AM
    Wednesday, September 5, 2018 10:11 AM
  • Turtle Ellipse filled (radial lines, param/polar)

    a = 200
    b = 150
    cx = GraphicsWindow.Width/2   ' 312
    cy = GraphicsWindow.Height/2  ' 221
    
    GraphicsWindow.PenWidth = 4
    Turtle.Speed = 10
    
    For deg = 0 To 359  ' 179   Move(2*r)
      rad = Math.GetRadians(deg)
      x = a * Math.Cos(rad)
      y = b * Math.Sin(rad)
      Turtle.X = cx + x
      Turtle.Y = cy - y
      
      '' Variant I:
      'Turtle.MoveTo(cx,cy)
      
      '' Variant II:
      r = Math.SquareRoot(x*x + y*y)
      Turtle.Angle = 270-deg  ' 90-deg  outwards
      Turtle.Move(r)  ' (2*r)
    EndFor
    PS: For Variant II, there's probably something wrong with Turtle.Angle (ray should touch center of ellipse in cx;cy)


    Wednesday, September 5, 2018 2:56 PM
    Answerer
  • This is my solution for the challenge to draw an anemone: ZFK355.

    Screen shot of a program Anemone


    Nonki Takahashi

    sb-online +anim update: LFS724

    sb-desktop + anim updt: HXF096

    • Edited by Tryhest Thursday, September 6, 2018 4:11 AM
    Thursday, September 6, 2018 4:08 AM
  • zx adapted graphic: JQX245

    (ld xtension required)

    Tuesday, September 11, 2018 8:18 PM
  • zx adapted viking ships: GWM904

    Wednesday, September 12, 2018 2:36 AM
  • colored chalk shapes: LGL627

    Wednesday, September 12, 2018 3:02 AM
  • This is my solution for the graphics challenges 1 to draw/fill ellipse with Turtle: RWJ975-0

    Screen shot of a program Ellipse by Turtle 0.4


    Nonki Takahashi



    Saturday, September 15, 2018 3:06 AM
    Moderator
  • 3] Draw a button with mouse over that changes the button color, and mouse click events.

    This is my solution for the graphics challenge above: MHC784.

    Screen shot of a program Button without Controls


    Nonki Takahashi

    Saturday, September 15, 2018 5:19 AM
    Moderator
  • 2points baloons: KTJ588

    Wednesday, September 19, 2018 6:17 AM
  • Hi,

    I'm away from home working for 2 weeks so the September challenges will run into October this month.

    Friday, September 21, 2018 5:11 PM
    Moderator
  • Hi All,

    I realize it's October and it's not a current challenge, but I thought I would post it here anyway.

    3D Math Plot

    1. Start the program.
    2. Click "Presets" near the top.
    3. Expand "snailspiral" in the tree menu
    4. Click on "4 turn snail half"
    5. Click "Select" near the top
    6. Click "Go"

    The program has too many features to describe here. But you can pan, zoom, rotate, etc. with the mouse and wheel and various mouse-key combinations to manipulate the object and camera.

    Thanks,

    cvmarus

    Saturday, October 27, 2018 12:33 AM
  • Perfect !  Nice Rotate-Funktion

    Saturday, October 27, 2018 12:01 PM
  • Hi backtothestart

    Thanks for the comment. This program is not finished it still needs work. Right now it is 60K in size so i'll have to be careful so that I can still publish it when it's done and it does not exceed the size limit.

    Saturday, October 27, 2018 4:16 PM