These challenges come from LitDev (and community submissions) 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 answers here:
It would be good if people could post their problems they encounter along with these challenges so that a discussion can start so that everyone can learn from each other.
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.
- Use the Turtle to follow your mouse.
- Write a program to draw a tree in the GraphicsWindow.
- Write a program to input and sum 5 numbers input by a user.
- Write a program to spell check the words in a sentense (use the Dictionary object).
- Write a program to play a few lines from your national anthem (use the Sound.PlayMusic method).
Maths Challenges – Project Euler
We had some of these challenges several years ago, but here are the first 5 again. The full set (some very hard) can be found https://projecteuler.net/archives.
1] Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
- 2] Even Fibonacci numbers
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
- 3] Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
- 4] Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
- 5] Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is divisible with no remainder “evenly divisible” by all of the numbers from 1 to 20?
Community Suggestion (By JetFire3201)
- Could we do a stickman running animation challenge?
- Suggestion – Create an animated stickman that can run and jump with animated limbs reacting to key presses.
Community Suggestions (By Zock77)
Advanced Artificial Intelligence (AI)
This is a facinating, but pretty tough challenge by Zock77.
- Check this out! It is so cool!
- Suggestion – Perhaps create a simple Artificial Neural Net (ANN) program that can be trained to a simple task like approximating an equation curve.
- Find the square root without using Math.SquareRoot (or any Math object methods if you can).
- Draw an ellipse using lines. (easy)
- Or for something more challenging: Make a filled ellipse without using ellipse methods.
- Write a program to find the GCF (Greatest Common Factor) of two numbers.
Community Suggestions (By Jibba Jabba)
We have a whole set of progressive graphical challenges by Jibba Jabba. Complete these and you will be right up there!
Use a Main loop for these and try nuzzling them into game loop structure.
- Make a square shape move from left to right of screen at a constant speed.
- Using arrays, place 2 more shapes on top of this shape and have them move in tandem.
- Make a circular shape move from the top to bottom of the GW at a constant speed.
- Now make this shape move on the same path from a standing start under the influence of gravity
- Now add friction/drag to this.
- Make a shape move horizontally across the screen bouncing off the edges with constant speed.
- Make a shape bounce from top to bottom from a standing start under the influence of gravity.
- Now add friction to this. Eventually the shape should stop.
- Make a shape move randomly all over the screen at a constant speed.
- Maybe apply some acceleration to this.
- Make a shape move in a circular path around a stationary shape placed in the centre.
- Add a satellite to this orbiting body.
- Have a go at changing the orbit to an elliptical path
- Add a continuous random barrage of asteroids that respond to any collisions
- Make a step up game where a ball bounces up a set of steps. User can move the ball left and right.
- Make a calculator. For a nice GUI check out Nonki’s website.
- Make some interesting Backgrounds. There was a recent blog on this by Nonki.
- Also make some interesting gradient backgrounds, can use RGB, random or constant fills for this. The backgrounds don’t have to be full window. If you make them extensible they can become part of your own code library.
- For advanced collision model some random balls colliding into each other.
Do you have an idea for a future challenge? Please post it here!
Thank you for joining us!
Small and Basically yours,
– Ninja Ed & LitDev