Small Basic Challenges - April 2015

These challenges come from litdev and 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).

Post your solutions here!

 

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 TextWindow program to read in 2 times of the day (24 hour clock) and calculate the number of minutes between the 2 times, eg 10:25 and 14:12 is 227 minutes .
  • Write a GraphicsWindow program to mimic a touch-tone telephone.

   

Musical Challenge

Write a graphical interface program to play the tuning notes for some instruments, for example:

  • Guitar
  • Violin
  • Trumpet

   

Graphics Challenge

Using the Flickr object now working in version 1.1, white a simple slide show in the GraphicsWindow. 

As an extra challenge try adding some fancy transitions like fade in/out, swipe, sprial in etc.

  

Game Challenge 

Write a slot machine game - pull the handle, spin the wheels and win win win.

  

Community Suggeston (by Pappa Lapub)

  • Stegano Image

Below there 2 images (a black and a white one, but could be any monochrome picture) that look rather boring. But both of them contain a very, very, .. OK & very important and secret message.

Simply write a SB program to reveal and view the hidden contents.
Hint: The red component in some parts of the image(s) is NOT as it should be on a pure black (or white/monochrome) image! Maybe even try to show the solution(s) in colors (eg. red, green; blue, yellow like on a MS flag)
PS: To impede cheating there's also included a simple 'flood protection'.
To create a similar image yourself, you would need LitDev Ext and ~ 10-20 lines of code.

  • NoSleep

Imagine you are running a huge download or another unattended process and you want to avoid, that your computer gets to sleep or hibernation, while you're away. Write a simple SB program, that keeps your system awake in the meantime.

Communit Suggestion (by Nonki)

Write a simple Logo interpreter which has following 6 commands:

  • FORWARD n (to move the turtle n pixels)
  • RIGHT n (to rotate the turtle right n degrees)
  • LEFT n (to rotate the turtle left n degrees)
  • PENUP (to lift the pen up)
  • PENDOWN (to set the pen down)
  • REPEAT n [commands] (to repeat commands n times)

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

Have a Small and Basic week!

   - LitDev & Ninja Ed