Small Basic Challenges of the Month! April 2016
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 that will remain 'sticky' for the month. The only rule is that your solution must use standard Small Basic 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.
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.
- Write a program that records your typing speed (words per minute). Consider using a multi-line textbox for the user to type into.
- Try to write the fastest code to calculate the sum of all prime factors of the first 1000 numbers.
For example the first 10 numbers (1 has no prime factors) have the following prime factors (2, 3, 2+2, 5, 2+3, 7, 2+2+2, 3+3, 2+5) and their sum is 45.
- Write subroutines to convert between RGB colour values and HSL (to and from). RGB are the Red, Green and Blue components, while HSL are the Hue, Lightness and Saturation. Using HSL to set colours can give nice effects. Start here to learn about HSL and maybe search for some online algorithms to help writing the conversioncode.
- Write a program using the HSL conversion to change the Hue (colour) of an image by changing each pixel. For performance reasons (it will be slow), try using fairly small images, say 100 by 100 pixels (that is still 10000 pixels to change).
- Write a program to play GO. Some AI would be great to play against the computer. Read aboutAlphaGo.
This month the communty suggestons for challenges were posted in separate threads. Thanks for all suggestions.
Post answers here or on the challenge threads linked to below.
- Create a fully functional calculator (8-digit, basic calculator, not scientific) but do all the calculations by hand...meaning that if the user wants 356 * 8...the program should multiply 8*6 then 8*5+4 then 8*3+4. Just like you would do it if you had to multiply with pencil and paper. This would require addition, subtraction, multiplication and division and as an added challenge, negative numbers. By jherch77 ( ORIGINAL POST ).
- Write a program to calculate how much power (watt) is necessary to climb an elevation of 5% grade. By Yvan Leduc (ORIGINAL POST).
- Write a program that could quantify the number of Watts uses the writing, storage on differentservers, and the delivery to the addressee of a simple e-mail? By Yvan Leduc (ORIGINAL POST).
- A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed, otherwise it is open. By Yvan Leduc ( ORIGINAL POST ).
Do you have an idea for a future challenge? Please post it here!
Small and basically Basic,
LitDev & Ninja Ed