Small Basic – The 50 Line Challenge

From Coding Cat:   

Working on developing projects for my Intro to Programming class, I reminded myself of an article I read back in the early days of the PC. The article was in one of the first PC only magazines, and it was publishing the results of a contest the magazine sponsored. Preliminaries complete, here is what they did:

They challenged their readers to come up with the most useful BASIC programs they could using only a single line of code in the BASIC interpreter. With the colon instruction separator you could easily get twenty commands on a single line. And the winning submissions were brilliant. One was a screen saver-esk art program, a second was a working word processor, and the third was a full sub chase game. I wish I could share the article and results with this group, but my net search for mention of the article turned up nothing.

So, in the spirit of the early days of PC programming, here is my proposal to all of you:

The 50 Line Small Basic Challenge!

I proposed this challenge about three years ago as the "25 Line Challenge", and it was such a success that it spawned a competition to see who could squeeze the most complex code into the smallest space. The results were brilliant. It was quickly discovered that you could use the String and Stack based nature of the arrays to produce some startlingly compact, obfuscated and unreadable code. I think the best example was Rock-Paper Scissors reduced to three lines (importCode: CTB433-2)

This time, to keep it from spiraling out of control and losing its impact on learning, I am going to suggest we keep it simple: One command or assignment per line, and no crazy use of arrays or other structures simple to squeeze into the limit.

So… Give us your clever, entertaining, most creative best, just keep it readable, and keep it under fifty lines.


Thanks to...

Avatar of Nonki Takahashi Nonki Takahashi - For suggesting this blog idea!

Avatar of Coding Cat Coding Cat - For creating and hosting the contest!
Now get in there and beat the challenge! Ask questions and discuss it here:
   - Tall Basic Ed
Comments (8)
  1. anonymouscommenter says:


  2. anonymouscommenter says:

    This is a bit cheeky, I know, but if someone wants to take part and hasn't got a BASIC to hand they could always try BINSIC, which should run anywhere you have Java.

  3. anonymouscommenter says:

    I think both Compute! and Soft Sector had one-liner contests. I submitted one to Soft Sector that was a darts game that let you use a joystick to move an "arm" and throw darts at a dartboard in profile. The physics worked, but I wasn't able to fit scoring into the one line. Ah, memories!

  4. anonymouscommenter says:

    @Adrian McMenami

    Er.. the clue is in the fact that this article is under Small Basic, as free MS version of Basic. I think using BINSIC may disqualify it, but way to plug your own (I guess) product.

  5. anonymouscommenter says:

    > Creative best

    > and no crazy use of arrays or other structures simple to squeeze into the limit.


  6. anonymouscommenter says:

    David, I would love to see the code, do you think you could recreate it in small basic?

  7. anonymouscommenter says:

    ascn;bcd;c CJAc; SC  AD.VN ' n D 'nsc sm; a '

  8. Rob, that's right! Why would you want to try some other BASIC, when Small Basic was designed specifically for students to learn!

Comments are closed.

Skip to main content