none
Challenge of the Month - November 2014 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.

    Also post feedback on the kind of challenges that you want to see more of in the future.

    Small Challenges

    • Write a program using the While statement to read numbers from the user until they enter a number between 5 and 10 (inclusive).
    • Write a program with several buttons to change the GraphicsWindow background colour. 
    • Re-write the buttons program so that it is as easy as possible to add new buttons. Hint: use an array of buttons.
    • Write a program to count the number of words, letters and vowels in a sentence.


    Intermediate Challenges

    • Write a program to calculate the mean (average) of some user entered numbers.  Can you also calculate the mode (most common) and median (middle of the numbers when ordered).
    • Write an alarm clock program.
    • Write a GUI (Graphical User Interface) with Buttons and TextBoxes or whatever you need to set the alarm clock program.


    Physics Challenge

    Write a program to model the movement of a yo-yo.  Try to get the rotation consistent with the up and down movement, and perhaps even add the jerk required when the yo-yo is fuly extended to keep it going. 

    The idea is not necessarily the exact physics, but something that unmistably looks like a yo-yo in action, maybe even some tricks.


    Graphics Challenge

    Write a graphical program that could be used as a screen saver.  Perhaps copy one of the existing MS screen savers or create your own.  It should be mostly black (to save the screen) with some movement to show the PC is active.

    Game Challenge

    Write a Puzzle Bobble game.


    Community Suggestions (By Nonki)

    • Match file names with wild card "*" or "?" in Program.Directory and make a list as an array.  "*" matches any characters including null and "?" matches any character.
    • Make a polyline editor.  Edited polyline can be saved and opened as a file.
    • Make a world clock.


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

    Thursday, October 30, 2014 7:11 PM
    Moderator

All replies

  • Late suggestion for Community Challenge: Mapping Challenge.

    A situation may arise where you want to click on an irregular shape and you need to know the exact location of each piece of the puzzle/map on the screen.

    Write a program that makes each piece of the jigsaw disappear when you click on it.

    HINT: use pixels as a legend for the map.

    You can use Paint.NET to color the pieces. Use "transparent" as a color and if you like overlay the pieces with shapes for animation.


    Some real world applications of mapping could be:

    • a national map of state by state
    • logistics, a building layout that pulls up more detail
    • and so on

    I'm also wondering if something different could be done to map a website? That shows the proportions of website section usefulness and a progression relationship of each section? instead of hierarchy access.

    In other words a website map that shows the user the most popular/used sections and a way to guide them if they need to go to some place first that still allows regular users to drill straight into what they want.


    Saturday, November 1, 2014 6:18 AM
    Moderator
  • This is my solution for physics challenge: WWD539.

    Use up arrow key to jerk the yo-yo.

    Screen shot of a program Yo-yo


    Nonki Takahashi

    Sunday, November 2, 2014 2:20 PM
    Moderator
  • My solution for physics challenge: JRT022

    jalpc


    jalpc



    • Edited by jalpc Sunday, November 9, 2014 6:08 PM
    Sunday, November 9, 2014 5:37 PM
  • jalpc, nice yoyo graphics!

    Nonki Takahashi

    Monday, November 10, 2014 8:51 AM
    Moderator
  • Nonki Takahashi , Thank you. 

    Not very technical ..... :)


    jalpc

    Monday, November 10, 2014 3:02 PM
  • This is my first step for community suggestion 3 by Nonki: BSP033.

    Screen shot of a program World Clock 0.1a


    Nonki Takahashi

    Tuesday, November 11, 2014 9:55 AM
    Moderator
  • One day entertaining: programming an alarm clock with Small Basic.

     ZTM411

    regards


    jalpc

    Saturday, November 15, 2014 5:53 PM
  • Wow! Nice graphics.
    Saturday, November 15, 2014 9:09 PM
    Moderator
  • This is my first step for community suggestions 2 by Nonki: CBF139.

    Screen shot of a program Polyline Editor 0.1a


    Nonki Takahashi

    Sunday, November 16, 2014 11:49 AM
    Moderator
  • This is my second step for community suggestion 3 by Nonki: BSP033-0.

    Daylight saving time is not supported yet.

    Screen shot of a program World Clock 0.2b


    Nonki Takahashi


    Monday, November 17, 2014 10:26 AM
    Moderator
  • This is my last step for community suggestion by Nonki: BSP033-1.

    Screen shot of a program World Clock 0.3b


    Nonki Takahashi

    Monday, November 17, 2014 3:45 PM
    Moderator
  • This is my sample for community suggestion 1 by Nonki: SVV671.

    Import this program and remove comments for File objects and run.

    [C:\Users\Nonki\SkyDrive\Documents\SmallBasic\File]
    
    Path? *.s*
    
    Wildcard.smallbasic
    
    Path? w*.*
    
    Wildcard.exe
    Wildcard.pdb
    Wildcard.smallbasic
    
    Path?

    Nonki Takahashi

    Tuesday, November 18, 2014 8:35 AM
    Moderator
  • This is my second step for community suggestion 2 by Nonki: CBF139-0.

    [Open] and [Save] are not supported yet.

    Screen shot of a program Polyline Editor 0.2a

    I decided the file format is SVG.

    <svg width='550' height='340'>
      <polyline points='19,314 223,314 209,183 146,181 217,105 217,46 249,45 253,87 285,54 437,179 368,178 366,303 524,316 507,223 489,298 459,217 433,289 409,216 383,289 272,298 265,173 319,172 323,281 186,300 168,215 134,285 116,174 76,288 37,186 23,296'
      style='fill:none;stroke:#000000;stroke-width:2' />
    </svg>

    Nonki Takahashi

    Thursday, November 20, 2014 4:37 PM
    Moderator
  • This is my third step for community suggestions 2 by Nonki: CBF139-3.

    Import this program and remove comments for File objects and run.

    Screen shot of a program Polyline Editor 0.31b


    Nonki Takahashi


    Friday, November 21, 2014 1:38 PM
    Moderator
  • These are my ideas for a future challenge.

    1. Write a program to find the star (zodiac) sign from birthday.
    2. Create a bowling score calculator.
    3. Create a program to draw all kind of tetrominoes (pieces used in Tetris).

    Nonki Takahashi

    Monday, November 24, 2014 10:24 AM
    Moderator
  • QXX945-0  Runs locally.

    My solution to community challenge: Mapping.

    Uses MouseMove and GetPixel to display Context Sensitive Data for each part of the Map.

    http://rickmurphy.byethost5.com/SmallBasic/ProgramListing/Map/assets/images/map-of-tasmania.png


    Wednesday, November 26, 2014 8:40 AM
    Moderator
  • I liked the use of "GetPixel to display Context Sensitive"

    In Spanish:

    me ha gustado el uso de "GetPixel to display Context Sensitive" :-)


    jalpc

    Thursday, November 27, 2014 4:34 PM
  • for community suggestion:  GDW511



    jalpc

    Friday, November 28, 2014 4:45 PM
  • My sample for Graphics Challenge (Screensaver)

    CoralReef.zip (10.34 MB) . Would'nt be much smaller as 7z. (Size ?!? ... contains a lot of images and an audio file)

    Day-/Night modes with and w/o frame. Press F1 for help and see included txt file.

    Sunday, November 30, 2014 4:47 PM
    Answerer
  • These are my ideas for a future challenge:

    Write a program to...

    1. Create a file filled with a given number of randomly generated characters or lines.
    2. Split a given file (eg. from 1.) to a specified number (eg. 3) of parts like FileName_1.part to FileName_3.part and save these into a folder.
    3. Merge all the FileName_N.part files from a folder into a combined file again.
    4. Compare two files (eg. orig. file from 1. and merged file from 3.) if they are identical.
    5. Bonus: If you do all from above, combine the functions 1.-4. into a single program.

    Sunday, November 30, 2014 4:54 PM
    Answerer
  • I looked but couldn't find a solution. I have my own interpretation of the first point of the Small Challenges.

    QJH089

    Friday, December 19, 2014 3:26 AM
  • Welcome and good try, ExtraSix.

    Following is my solution.

    While num < 5 Or 10 < num
      TextWindow.Write("Number? ")
      num = TextWindow.ReadNumber()
    EndWhile


    Nonki Takahashi

    Friday, December 19, 2014 6:59 AM
    Moderator
  • Nice interpretation.

    I used the same loop header as you:

    While numberRead < 5 Or numberRead > 10
    HXL123

    Friday, December 19, 2014 7:05 AM
    Moderator