trefny.net

Index | Articles | Bits & Bytes

1. LF Scheme Interpretter
2. Crux92


LFScheme is a small Scheme interpretter that I wrote sometime in 1999 when I pondered the idea of having a Lisp-like scripting language in a game engine. It may seem stupid at first, but at that time a game project called Golgotha released its source code and that was where I saw a Lisp- like scripting language used in a game for the first time. Believe me, it didn't look that bad. Lisp was widely used at M.I.T. during 70s. Scheme is a simple dialect of Lisp with a small and efficient implementation. The beaty of it is that a part of the language can be written in itself. Scheme is a totally different language than, for example, C++. It is forcing you to keep a different line of thinking. Among other things, I believe it is good for every programmer to know the principles of other programming languages.

(define fact
 lambda (n) (if (= n 0)
             1
             (* n (fact (- n 1)))))

LFScheme is not complete (concerning its specification as covered in "Revised(5) Report on the Algorithmic Language Scheme.") It has all that I needed at the time of its development. The download package is here. It's written in Java. The file "library.scm" is where you can find what's missing from this implementation (compared with the document mentioned above). Entries beginning with "TODO" can be implemented in Scheme and "NO" denotes features requiring changes to the Java code.


Press for level survey One day I visited a site with tons of games for ZX Spectrum (an 8-bit computer popular in Europe during 80s). It was my first "real" computer on which I've actually gained my first programming skills. On that site, I've also found a snapshot of a game I wrote some 12-13 years ago, at the beginning of 90s, at a time when all these machines were being replaced by Amiga, Atari ST, and even later on by PCs. The game is called Crux 92. You can grab a snapshot for an emulator here or you can go here and play it on-line. The language is Czech, but you can answer 'N' to all the initial questions, press '0' to start the game and use the keys 'O','P','Q','A' to control the vehicle. The goal is to position some red boxes in the path of those moving robots to force them to run into a mine and explode. I remember programming the game with just a tape machine, so no floppy disk or microdrive to store the source code. Everything must have been in the Z-80 assembler - that's how games were programmed at that time. As I only had the 48kB version of GENS (an assembler editor and machine code compiler), in the middle of development I ran out memory which could no more store all the source code. So the GUI was separated and had to communicate with the game core via something, which now we'd call an interface, but at that time it was just a fixed place in the memory with an array of addresses to other procedures (similar to the library base used in the Amiga OS).

© 2002-5 Marek Trefny