Small Basic Challenge of the Month - May 2014

Another month of challenges from LitDev!

Share your results in our forum:

https://social.msdn.microsoft.com/Forums/en-US/0fa31cf0-1957-469c-b878-7ca6728ff1b2/challenge-of-the-month-may-2014?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.  The only rule is that your solution must use standard SmallBasic 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.

Curriculum Challenges 3.5

  1. Write a GraphicsWindow program with TextBoxes that you can enter your name and age.
  2. Extend the program to include a Button that takes the entered data and adds it to an array of this information.
  3. Create Buttons to load and save the data array data to a file.
  4. Finally add Buttons to step through the data array and display it in the name and age TextBoxes.

TextWindow Challenges

  1. Write a program to count the length of words in an input sentence.  The program should say how many 1 letter, 2 letter, 3 letter etc words there are.
  2. Write a program to input 5 numbers, then calculate their sum (add them) and their product (multiply them).
  3. Write a program to input some text, then somehow convert it to notes (one for each letter) played by the Sound object.

Graphics Challenge

  1. Write some simple optical illusions.  Here is one to give the idea.

Maths Challenge

  1. I have a card game called "dobble".  It has 55 cards and each one has 8 different pictures on it.

 

The interesting thing is that any and every pair of cards that I choose at random has exactly one object in common.  In the pair above they share a red clown face.  Note that there is never more than one shared picture for any pair of cards.

The challenge is to write a program to allocate pictures for each card.  You can use as many pictures as is necessary to do the task.

HINT - use numbers rather than pictures to do the calculations.  You don't actually need the picture images, just replace the unique pictures with numbers.

The program should say which images (or numbers) should be on each card.

How many images (or numbers) do I need for the 55 card pack?

Game Challenge

  1. We have had the vertical scrolling game last month, so now it's the platform game.  The challenge is to have some stationary platforms at varying heights that the player can move along (Left and Right) and jump (Space) up and down to.  If the player falls too far (misses a platform) then they die.
  2. If you get the player jumping to platforms, then create a game out of it with some objective or scoring.

 

Community Suggestions ( by Ed Price )

"Initially, I thought about making it completely interactive, i.e., a math problem is displayed on the screen, it will wait for an answer (with a timer if necessary), check the answer, add it to the tally, and finally gives the grade after all 20 questions are completed."

From this blog post from Ray Fast:

https://blogs.msdn.com/b/smallbasic/archive/2014/04/29/a-math-worksheets-generator.aspx

You could even start with his code and build it from there.

Community Suggestions ( by Nonki )

  1. Create a word list from a text file.
  2. Draw a geometric pattern.
  3. Draw an animation of a moving robot.

 

 

Some answers already last month by Athasak!

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

Thanks to LitDev for these great challenges!

   - Ninja Ed