Another month of challenges from LitDev!
Share your results in our forum:
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
- Write a GraphicsWindow program with TextBoxes that you can enter your name and age.
- Extend the program to include a Button that takes the entered data and adds it to an array of this information.
- Create Buttons to load and save the data array data to a file.
- Finally add Buttons to step through the data array and display it in the name and age TextBoxes.
- 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.
- Write a program to input 5 numbers, then calculate their sum (add them) and their product (multiply them).
- Write a program to input some text, then somehow convert it to notes (one for each letter) played by the Sound object.
- Write some simple optical illusions. Here is one to give the idea.
- 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?
- 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.
- 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:
You could even start with his code and build it from there.
Community Suggestions (by Nonki)
- Create a word list from a text file.
- Draw a geometric pattern.
- 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