Small Basic Programs in 25 lines
Note: All the programs listed below can be downloaded directly into Small Basic. Just import the programs using their published Id.
What started as a fun challenge in our Small Basic Forums, quickly turned into a repository of very interesting programs, all conforming to a 25-line limit. It is amazing to see enthusiastic participants come up with very creative patterns to embed complex logic in as few lines as possible.
The challenge started with the classic game of Rock/Paper/Scissors, written in 24 lines by Coding Cat and published as CTB433. This was meant to be just an example for the challenge, but within days, Jason Jacques posted a 9 line version of the same program, published as CTB433-1. And the race was on.
Recently Rushworks posted a trick to initialize Small Basic arrays in a single line. Hours later, Davey-Wavey came up with a feature-par version of the original Rock/Paper/Scissors in 3 lines flat! This version is published as CTB433-2.
And using a few tricks and assumptions about the size of the text window, Jason came back and posted the same program in just 2 lines! It is published as CTB433-5.
As this race was going on, litdev published the Swarm of Bees as MSH031 in 25 lines.
Simultaneously, Dudeson published a similar program, RRS083 which simulates an atom with the mouse center as the nucleus. And Grzegorz Tworek, published his Lissajou’s Curve simulator program as GQP876, in 11 lines.
Dudeson went back and improved his atom code to publish RPW587, which runs much faster.
Other programs that you’ll find on this forum:
by Jason Jacques: CGW786
by Coding Cat: KDN168
also by Davey-Wavey: KDN168-0
by Davey-Wavey: XDK444