Write-Only Memory:
The Blog of Kevin Thomasson

DIY, electronics, programming / whatever.


Sometime in 1995, me and a friend of mine created a program called Atom in QBasic during one of our weekly computer-nerd meetups. The principle of the program is simple; atoms smash into one another creating even more atoms. Atom creates very interesting results despite its simplicity, and we wasted a considerable amount of time watching atom collisions and modifying parameters back in the day.

ATOM.BAS running in QuickBasic 4.5 inside DOSBoxATOM.BAS running in QuickBasic 4.5 inside DOSBox

Ten years ago, when I was learning to program Java at the university, I wrote a program emulating the behaviour of the original program as an Java applet. I was in search of this code for reference and inspiration as I am planning to make a version for the Commodore 64. While searching I stumbled upon the original QBasic files! I was able to execute the program after installing DOSBox and finding a copy of QBasic. Fueled with nostalgia and inspiration, one thing led to another, and before I knew it I had created a pixel-perfect (at least in Chrome and Firefox) JavaScript port of Atom—including implementing a routine to print text using the VGA 8x8 bitmap font on a HTML canvas :)

Original Atom ported to JavaScript

Updated version

It would be next to impossible not to tinker with the program and trying out some new ideas at this point. This updated version has the following new features:

Updated version of Atom

Give it a few spins! The program is restarted by simply clicking on the canvas. Feel free to copy the code from the page source and modify it in any way you se fit—as long as you share it with me :)

Ugly code disclaimer: The first version is more or less ported line-by-line from the 1995 QBasic program.