Asteroids in CAL

Asteroids is a little game that demonstrates how a stateful graphical application can be written in CAL.

History

Asteroids was originally written in Haskell by Dr Christoph Lueth at DFKI Lab Bremen. His original program can be found here and here. The CAL version was mainly written as an exercise to learn the language. It also turned into a interesting exercise in the understanding the Haskell IO monad. CAL has very similar semantics to Haskell 98, but monads have not been used to implement I/O. CAL is not a pure functional language and so, unlike Haskell, functions can exhibit side effects. Nevertheless, monads can be implemented in CAL and by using these, a pure application can be created. The the original Asteroids program was seen as an excellent test application for the implementation of the Haskell IO monad. The original program was written to use the SOEGraphics library (which I think is now part of the HGL Graphics Library). Fortunately Tom Davis had implemented all the required parts of this graphics library in CAL.

Downloading Asteroids

The source is here.

Running Asteroids

Asteroids can be run:

  1. From ICE
  2. Standalone
  3. As an Applet.
It should look something like this:

Contact

Nik Shaylor