Small Basic – January & February 2016 Challenges!!! (Card "Snap" Game, Slalom Skiing Game, Gravity Ball, Holiday Calendar, Countdown, Pathmapping, Background Color, & File Management)


Challenge of the Month – January+February 2016

Click here to participate:

https://social.msdn.microsoft.com/Forums/en-US/32e9fde9-7d4e-481e-979e-e73afcae38f6/challenge-of-the-month-januaryfebruary-2016?forum=smallbasic

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. Post here!

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

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

  

Basic Challenges

Write prgrams to:

  • Count down from 10 seconds, displaying the time counting down
  • Modify the countdown timer to play a sound with increasing pitch frequency as the timer reaches zero
  • Add a visual display of some kind to show the countdown, perhaps an egg timer or decreasing bar or something fun
  • Read an option from the user to select a GraphicsWindow background colour from a list.
  • Consider the best way to make it easy for the user to change the colour, maybe by keys, mouse or buttons
  • Move an ‘X’ in the TextWindow
  • Load a GraphicsWindow layout of some shapes from a file, so the shapes can then be read and drawn as specified by the file.  You will need to define the format for the data stored in the file, try to make it so that you can edit the file in notepad to define the layout as easily as possible

 

Graphics Challenges

Write prgrams to:

  • Move an image smoothly with the arrow keys
  • Move an image or shape with the mouse, try to make a ‘click and drag’ feature
  • Add a feature to rotate a selected shape with the right mouse button down
  • Finally you can check if the Shift or Control key is down to zoom or fade the shape
  • Draw a dynamic picture of a moving river.  Hint: try using a Timer or ‘game loop’ to move, rotate, zoom or change opacity of some wave type objects to give a flowing effect.
  • Try making some other dynamic visual effects like fire, fog etc.

  

Physics Challenge

  • Write a program to calculate and draw a ball that bounces with gravity and gradually slows with each bounce.

  

Game Challenges

  • Write a simple slalom skiing game.

 

  • Write a card ‘snap’ game where random cards played in turn by each player.  When 2 cards with the same face value are shown the player first to press their key wins the cards.  The player that wins all the cards is the winner of the game.  The cards can be images like below or ordinary palying cards.

 

Community Suggestion (By Zock77)

  • Write a pathmapping program.  If you want to do a hard one, you might try to use the A-star algorithm, or for something a little easier, the Breadth-first algorithm.

 

Community Suggestion (By Nonki)

  • Make a calendar program with holidays 2016 in your country.

 

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

 

Thanks for participating! The more you learn, the more you’re helping others to learn too!

Small and Basically yours,

   – Ninja Ed & LitDev

Comments (16)

  1. Tryhest says:

    Zodiac stars:

    1) create DB file: KTG313

       * be sure to unmark commented line and change destination drive for DB file

    2) use viewer: RVM680

       *change db drive to file created in step 1 and uncomment neccesary lines

    select name from combobox to view constelation stars

    Enjoy!

  2. Nice. Good job on these!

  3. Tryhest says:

    tx ed))

    now try this one: SHN280

    to create input file for testing above app import this one:NCM426

    and save to test.plt

    or u can use any HP plotter file (e.g. coreldraw export HPGL PLT)

  4. Tryhest says:

    skyscrapers: XDB974

  5. Tryhest says:

    rotating globe: PCX826

    best effect when  rotate slowly mousewheel

  6. JetFire3201 says:

    for the smoke or fire, GGL814 is my program but im having an issue with the delete part, other than the delete part is works great until the computer has to update 300 particles at once. If someone could help me with that that would be great

  7. Tryhest says:

    I used fastshapes from LD xtension to speedup ur smoke, hope achieved ur desired effect: GGL814-0

  8. Tryhest says:

    u can increase no of dots upto 250, after which it slows down significantly

  9. Tryhest says:

    3d planerarium: SJM428

  10. JetFire3201 says:

    interesting, but saadly thats not the desired affect. Im trying to remove the shape, at a certain place, not move it. that way i ca have a constant-ish number of shapes always showing. if you look at a capfire, the smoke from it can be seen for a while but then vanishes. im trying to achieve that. method->

    1. make shape

    2. move shape in loop

    3 delete it when it gets to a certain part (mimicks vanishing)

    also these challenges are not suppose to have 3rd party apps like litdev or fc.

  11. JetFire3201 says:

    ok, i fixed it YASS!!!. the import code is-> WRH243. If anyuone would love to modify it to make it better plz do i would love to see the creativity.

  12. Tryhest says:

    ur code constantly create and destroy objects. it's a bad programming habit bcs it wastes memory. try to reuse existing objects instead of creating new same ones.

  13. Tryhest says:

    as result of analysis with wintaskmanager comes out that ur code consumes 10 Mb of ram with only 30 balls, while mine consumes only 5 Mb ram with 100 balls running                                                                                                                                                                                                                                    

  14. Tryhest says:

    3 sinewave emulators:

    BQC868

    FRR698

    HXJ051

  15. These are great. Thanks, Tryhest and JetFire!

Skip to main content