Challenge of the Month - September 2016 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.

    Turtle Challenge

    Write program with buttons to move the Turtle in the GraphicsWindow.

    Multitasking Challenge

    Write a program to do several things at the same time.  There are two main ways to try to do this using event threads like the Timer or by time slicing (game loop).  Try to the find solutions that can be easiy extended.  Some of the thngs to do 'in parallel' below are harder than others.

    Try to write a program to do as many of the following at the same time - no extensions.

    • Continually change the GraphicsWIndow backgrund colour every second between black and white
    • Get the Turtle to keep moving round the outside edge of the GraphicsWindow in a rectangle
    • Keep randomly repositioning the GraphicsWindow on the desktop every 2.5 seconds
    • Play the Click sound every 3.2 seconds
    • Add an ellipse shape that changes its colour every 0.5 seconds
    • Continually move an ellipse shape in the GraphicsWindow like a bouncing ball
    • Anything else you can think of

    TextWindow Challenge

    Create a program that accepts some text from the user and randomly does one the following with it.

    • Reverse all the letters
    • Echo with all vowels in red
    • Colour the words Red, Yellow, Red etc
    • Replace all numbers with an *

    Community Suggestion Challenges

    • 2D or 3D dices rolling simulation (By YLed) LINK
    • Sun vs Betelgeuse (By YLed) LINK
    • Draw a Face (By Nonki) LINK
    • Photograms (By YLed) LINK

    Screen shot of a program Draw Arc 0.2

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

    Thursday, September 1, 2016 6:50 PM

All replies

  • Fun Challenges !!
    Thursday, September 1, 2016 7:04 PM
  • Hi Litdev !

    i don't know if this program fit in the Turtle challenge, but it's fun !

    This program does many things:

    1) load an image of cloud and blue sky

    2) get each pixels of the colors of the sky , left to right, top to bottom

    3) transfer the colors pixel to the turtle pen.

    4) the turtle start to draw forms and paint it over the cloudy sky

    5) the colors palette include only the values of the sky and cloud, so blue, white and gray, in  millions of shades.

    here is the program:  KNP816

    first step:

    the final drawing look like this ( surrealistic art )

    • Edited by YLedEditor Thursday, September 1, 2016 11:52 PM some orthograph
    Thursday, September 1, 2016 11:45 PM
  • @YLed

    I was thinking of buttons to turn left, right, go forward etc, but its just an idea to get people coding and I like your program - its more interesting than my idea.

    Friday, September 2, 2016 6:09 PM
  • @litdev cool !!

    here is another version with clouds, the Turtle draw rainy shapes, using palette colors from clouds.

    program: CGX173

    @litdev: How can i hide the turtle start point to go to the first draw point ? ( in red)

    • Edited by YLedEditor Saturday, September 3, 2016 12:16 AM
    Saturday, September 3, 2016 12:11 AM
  • Maybe like this

      For j = A To B
        pixel = GraphicsWindow.GetPixel(k,j)

    Saturday, September 3, 2016 7:54 AM
  • This is my solution for the turtle challenge:

    GraphicsWindow.BrushColor = "Black"
    btnMove = Controls.AddButton("Move 100", 10, 10)
    btnTurn = Controls.AddButton("Turn 90", 10, 40)
    Controls.ButtonClicked = OnButtonClicked
    While "True"
      If buttonClicked Then
        btn = Controls.LastClickedButton
        If btn = btnMove Then
        ElseIf btn = btnTurn Then
        buttonClicked = "False"
    Sub OnButtonClicked
      buttonClicked = "True"

    Nonki Takahashi

    Monday, September 5, 2016 1:14 AM
  • This is a solution for the multitasking challenge: ZRX774.

    Screen shot of a program Multitasking Challenge

    Nonki Takahashi

    Monday, September 5, 2016 4:41 AM
  • Hi ! my answer to the multitasking challenge:

    first task )      open many images in sequence, ( cumulus sequence )

    second task )  move a meteorite shape in the sky

    ( note: the original sequence of clouds contains a hundred photos taken at 5 second intervallle. So, on my computer, the scrolling of the clouds in the sky and the wind in the trees is really real. Here for the need of the demonstration, as this forum limit to 9 photos by publication, I put 6 images of clouds, the result is is not a continuous movement.)

    program no: QRC674

    • Edited by YLedEditor Monday, September 5, 2016 3:39 PM somes orthograph
    Monday, September 5, 2016 3:00 PM
  • Here is my solution for the TextWindow challenge: DWM417.

    Screen shot of a program Text Converter 0.1

    Saturday, September 10, 2016 2:56 AM
  • Hi LitDev !

    this is my program to the textwindow challenge.

    1) the user enter a text

    2) each letters of the text is display with a sound effect of a classic typewriter , echo in blue color

    3) a goto statement run it again and again  , have some fun !!

    program no: FDK641

    • Edited by YLedEditor Saturday, September 10, 2016 3:56 PM
    Saturday, September 10, 2016 3:54 PM
  • Hi !

    this is my new version for the text Challenge for Sept.

    it read an input text by the user

    it display the text

    it display the text with all letters inversed.

    it display the text with a red letters every 2 letters.

    it display all text with a digital old computer of the 80's sounds.

    program: HVV233

    • Edited by YLedEditor Sunday, September 11, 2016 3:54 PM image changes
    Sunday, September 11, 2016 3:47 PM
  • This is my version for the Photogram Challenge ( without extensions )

    ( draw ellipse,  draw triangle , for the scissor image ) ( draw rectangle for the 35mm strip image )

    ( a special Unicode character U+231A - the Watch )

    ( a leaf image inverse with a getpixel , analyse density and then setpixel black or white depending on the threshold set in the algorhytm )

    program no: RPT439

    Wednesday, September 14, 2016 1:34 PM
  • This is my solution for the Turtle Challenge:

    '' Write program with buttons to move the Turtle in the GraphicsWindow.''

    program no : MXX398

    Wednesday, September 14, 2016 6:13 PM
  • This is an another version of the turtle challenge.

    Screen shot of a program Turtle Navi

    GraphicsWindow.BrushColor = "Black"
    GraphicsWindow.FontName = "Segoe UI Symbol"
    GraphicsWindow.FontSize = 20
    btnLeft = Controls.AddButton("⇦", 10, 50)
    btnUp = Controls.AddButton("⇧", 50, 10)
    btnRight = Controls.AddButton("⇨", 85, 50)
    btnDown = Controls.AddButton("⇩", 50, 90)
    Controls.ButtonClicked = OnButtonClicked
    Turtle.Speed = 9
    While "True"
      If buttonClicked Then
        btn = Controls.LastClickedButton
        x = Turtle.X
        y = Turtle.Y
        If btn = btnLeft Then
          Turtle.MoveTo(x - 50, y)
        ElseIf btn = btnUp Then
          Turtle.MoveTo(x, y - 50)
        ElseIf btn = btnRight Then
          Turtle.MoveTo(x + 50, y)
        ElseIf btn = btnDown Then
          Turtle.MoveTo(x, y + 50)
        buttonClicked = "False"
    Sub OnButtonClicked
      buttonClicked = "True"

    Nonki Takahashi

    Monday, September 19, 2016 12:45 PM