The Card Game Language

The Card Game Language, or CGL for short, is a language which was developed during my fourth semester as a software engineering student. It was created by me and six of my fellow students in a project dedicated to the subject of language and compiler theory.

The Language

CGL is an interpreted language which is used to describe card games (currently only solitaire type games). The point of the language is to combine it with an interpreter which transforms a code file into a playable game. The language aims to describe a card game as a non-programmer might think about it which means that it closely follows the metaphors of card games. This should make it a comparatively easy language to approach, and not only for programmers.

To make it easier for people to develop card games in CGL I provide a couple of tools for Notepad++. The package contains files to configure the editor with syntax highlighting and auto completion as well as a game template file so you don't have to figure out the overall structure of a game. For instructions on how to install the files, the package includes a readme file. For those who are into language theory, the language grammar is included as well, so you can get the complete picture of the language syntax.

A Silverlight Interpreter

The reason I write about our old language here is that I've ported the old winforms-based interpreter to one which is hosted in Silverlight. The interpreter allows you to upload your own CGL code to try out your games as well as a number of existing games.

The interpreter is in ongoing development and I have recently released a third version, which you can try out here. The second version, also implemented in Silverlight, can be found here for reference. The second version is currently the only one supporting uploaded games to be played.

Evolving the Language

Working with the CGL has made it apparent that the language is far from perfect and lacks certain capabilities for expressing game concepts and keeping the code concise. The language was designed around the case of the classical Solitaire game which accompanies Windows installations. This means that a lot of game styles can be hard or impossible to represent in a reasonable amount of code. In addition, there are simply a number of quirks and oversights in the language which have yet to be ironed out.

To improve the language and generally make the experience of writing card games better, I'm currently working on a new implementation of the language using a custom compiler rather than the interpreter from the first port. To document the process I'm putting together a series of articles as I go along, which will be linked to below. See the first article for details on the goals and motivations for the project.