- Write a program that moves a ball when the mouse is moved (the ball stays under the mouse).
- Extend the program above to leave a trail behind the moving ball.
- Write a TextWindow program to enter a date and then validate that it has the correct format (e.g. DD/MM/YYYY or MM/DD/YYYY).
Make sure it handles leap years!
- Write a program to replace all spaces in some text with ‘_’.
- Write a program to create 5 buttons in a vertical column, when each is clicked it plays a different sound or musical note.
- Write a program to generate random letters (a-z).
This challenge is to create an extensible ‘Paint’ program with plugins.
There are several paint type programs in Small Basic – they mostly consist of drawing on a window following a mouse when a mouse button is clicked and held down.
The idea of this challenge is:
- to write the main program in such a way that it is easy for people to add their plugins.
- to write fun plugins.
A plugin may be as simple as changing the line width or color, or more complicated like drawing stars or any other feature.
The plugins should:
- be a single subroutine.
- have a name that can be obtained from the plugin, so that it can be selected.
- either perform drawing actions when the mouse is moved while a mouse button is down or change some property.
Quite a bit of thought will be needed to design the program so that plugins can work well, be selectable etc. Perhaps plugins need to also be added to a text file list of plug-ins?
Examples of plugins could be:
- Change brush color.
- Change pen thickness.
- Draw random colored stars as the mouse moves.
The program itself should have only a very basic plugin example and it is up to other contributors to create their plug-ins meeting the required specification.
I recommend some discussion/collaboration of ideas before coding, perhaps start from the example in the ‘Introducing Small Basic’ guide.
GraphicsWindow.MouseMove = OnMouseMove
GraphicsWindow.MouseDown = OnMouseDown
prevX = GraphicsWindow.MouseX
prevY = GraphicsWindow.MouseY
GraphicsWindow.DrawLine(prevX, prevY, x, y)
Write an ‘air hockey’ 2 player game.
- Make a unit converter.
For example 1 kilogram is 1000 grams.
So make a program to convert the kilogram to 1000 grams.
- Make a basic chat program (Example JDT558).
- Make a RGB (red – green – blue) menu with sliding bars that changes the background color (Example NHJ269).
- Make a “Scroll Down Bar”, you know… a bar that scrolls down some text or shapes or images (Example ZDP541).
- Make a program to change pages of text when you click and drag the page to the left edge of the window (in order to see the next page) and when you click and drag the page to the right edge of the window (in order to see the previous page).
It may sound kinda confusing so here is an example SFR639.
- Create a international version of Hello World program.
- Create a program to show Small Basic source.
Comment lines must be shown as green.
- Draw a picture of a regular triangle.