none
Challenge of the Month - June 2017 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.

    Small Challenges

    • Write a program to input numbers from a user and only accept numbers that are a perfect square (e.g. 4, 9, 121)
    • Write a program to print out the first 20 Fibonacci numbers
    • Create a Fibonacci curve

    Graphics Challenges

    • Create an arrow (or use Turtle) that always points towards the mouse as you move the mouse over the GraphicsWindow
    • Create a neon sign - add any text or images or even make it flash

    Physics Challenge

    • Create an image that shows the field lines between a positive and negative charge
    • Try to extend it to show field lines when then the user adds positive and/or negative charges anywhere on the GraphicsWindow

    Text Challenge

    • Create a program to count the number of lines, words and charaters in a file.  For this challenge a word is any connected set of alpha-numeric characters of any case (a-z,A-Z,0-9)
    • Use the program to count lines, words and characters in your program file
    • The challenge is to use the smallest number of lines, words or characters

    Game Challenge

    • Create a 'hangman' word game

    Community Suggestions

    • Dictionary / Word game challenge - (By Coding Cat)

    I created a dictionary array in Small Basic.  I limited it to 3000 common words of length five or more to allow it to be imported.

    I think it would be fun to see what people can do with it.

    The dictionary array: HKZ204

    The app I wrote to create the word array from any list of words: HDJ631-0

    • How many triangles - (By Anti-Freeze)

    Puzzle()
    Program.Delay(1000)
    Sub Puzzle
      GraphicsWindow.DrawRectangle(10,10,400,400)
      GraphicsWindow.DrawLine(10,10,410,410)
      GraphicsWindow.DrawLine(410,10,10,410)
      GraphicsWindow.DrawLine(10,210,410,210)
      GraphicsWindow.DrawLine(210,10,210,410)
      GraphicsWindow.DrawLine(10,10,410,210)
      GraphicsWindow.DrawLine(10,10,210,410)
      GraphicsWindow.DrawLine(10,410,410,210)
      GraphicsWindow.DrawLine(10,410,210,10)
      GraphicsWindow.DrawLine(410,10,210,410)
      GraphicsWindow.DrawLine(410,10,10,210)
      GraphicsWindow.DrawLine(410,410,210,10)
      GraphicsWindow.DrawLine(410,410,10,210)
    EndSub

    I have written my first little Small Basic program to calculate the answer but would welcome an independent view or solution which would verify my result.

    Some answers already on last month's challenge thread.

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

    Thursday, June 1, 2017 6:32 PM
    Moderator

All replies

  • How many triangles - (By Anti-Freeze)    JDC603

    original code is made by Anti-Freeze.  speed up and show triangles (shapes) . avoided duplicated triangles.

     

    Friday, June 2, 2017 1:31 PM
    Answerer
  • I wrote a solution for a graphics challenge: KFD409.

    Screen shot of a program Neon Sign


    Nonki Takahashi

    Saturday, June 3, 2017 2:42 AM
    Moderator
  • I wrote a program sqare challenge ZVL231.

    Best Regards Martin

    Saturday, June 3, 2017 11:35 AM
  • The maximal Fibonacci number in small basic show GMG940.

    Best Regards Martin

    Saturday, June 3, 2017 12:04 PM
  • Another Neon method, MBK196

    Saturday, June 3, 2017 3:17 PM
    Moderator
  • An idea for a future game challenge it is an olg c64 game named QUIX. Show it on https://www.youtube.com/watch?v=xSesJhl4QdA.


    Best Regards Martin

    Sunday, June 4, 2017 10:25 AM
  • This is my solution for a community suggestion: BBL935.

    Screen shot of a program Puzzle - How many triangles?

    I confirmed that this program shows the same answer with NaochanON's.


    Nonki Takahashi


    Monday, June 5, 2017 2:50 PM
    Moderator
  • This is my solution for small challenges: RZL408.

    Screen shot of a program Fibonacci


    Nonki Takahashi

    Monday, June 5, 2017 3:50 PM
    Moderator
  • PKX286 for Fibonacci curve


    Thursday, June 8, 2017 4:49 PM
  • Electric field lines - XSD072

    Thursday, June 8, 2017 6:49 PM
    Moderator
  • Electric field lines - XSD072

    This is amazing! Ive been struggling on this one for like a day, still cant figure out how to do it. 
    Thursday, June 8, 2017 7:59 PM
  • hello everybody a program ID WNH607-0 was send to me by a net guru way back i dont have a clue about it i think LD extantion is used i dont know how to use the ld extantions please some one write the program without LD Extantion or give us some lessons about ld extantions as long as i understand the forum is to spread and teach small basic with thanks and regards
                                                                                                 mahreen miangul

    Sunday, June 11, 2017 5:59 AM
  • hello everybody a program ID WNH607-0 was send to me by a net guru way back i dont have a clue about it i think LD extantion is used i dont know how to use the ld extantions please some one write the program without LD Extantion or give us some lessons about ld extantions as long as i understand the forum is to spread and teach small basic with thanks and regards
                                                                                                 mahreen miangul

    Hi mussamaina,

    Perhaps ask a question like this on a new question thread, leaving this thread for challenges, their solutions and discussions.

    Thanks.

    Sunday, June 11, 2017 9:57 AM
    Moderator
  • mussamaina,

    You are correct. The program you reference does use the LD extension. To load the extension and to learn about it do the following:.

    1. type "smallbasic.com" into your url

    2. when that opens take the link for "Extensions" in the lower right corner of the page. From there find the link that says "LitDev Extension" and click on it.

    3. that page tells you what you need todo to download the extension and the steps that you need to take to get it to work on your computer.


    JR

    Sunday, June 11, 2017 10:02 AM
    Answerer
  • Rotating arrow challenge, DMX561.

    Surprisingly tricky using line and triangle shapes - some experimentation with simple test programs is needed to work out how they are moved and rotated.  This is an example of one of mine, SLC413.

    Sunday, June 11, 2017 3:08 PM
    Moderator
  • simple quix show NDF646.

    Best Regards Martin

    Thursday, June 15, 2017 12:15 PM
  • cool neon nonki))

    update to make it glow n flash:RRF718

    Friday, June 16, 2017 9:11 PM
  • cool neon nonki))

    update to make it glow n flash:RRF718

    +1
    Friday, June 16, 2017 9:21 PM
    Moderator
  • QUIX Update:

    Show TKF095


    Best Regards Martin

    Saturday, June 17, 2017 1:27 PM
  • PKX286 for Fibonacci curve



    Hello George_Fung, this is a simple program!  Thanks.

    Nonki Takahashi

    Monday, June 26, 2017 1:36 PM
    Moderator
  • Hello Coding Cat, I think following line (59) is not needed in HDJ631-0.

      token = ""


    Nonki Takahashi

    Monday, June 26, 2017 2:04 PM
    Moderator
  • This is my more tricky version of arrows: RDJ626-0.

    Screen shot of a program Arrows

    Shapes parameters were decided according to this rule.


    Nonki Takahashi


    Monday, June 26, 2017 3:13 PM
    Moderator
  • nice work nonki!

    updated and optimized ur arrows:  RDJ626-1

    • used ldarrows
    • faster movement
    • colors changed
    • reduced codelines
    • mswheel regulates arrow angle offset - interesting effects like wortex and magnetic repulstion lines

    Thursday, June 29, 2017 7:11 AM
  • update PKX286-0

    added lines and zoom in-out with mswheel

    Thursday, June 29, 2017 7:28 AM