LISP‎ > ‎LISP Project - Flow Game‎ > ‎

Grids in LISP Exchange Format

Share your grids in the folder below, in LISP exchange format. Request edit permission on this folder, if you wish to drop your own grid in this format. See definition of Grid  LISP Exchange Format below.

Flow Grids - LISP exchange format


Remark: A different common file format has initially been proposed for Flow Game grids, so that teams can easily share grid examples among the whole class. The initially proposed format is neutral, not specific of any programming language, thus favoring interoperability. Indeed, the initially proposed format does not fit in LISP spirit, which naturally promotes similarity between programs and data, with lists as the main datatype supporting both the representation of data and functions. The initially proposed format also limits the number of colors to 36 (which may be considered as large enough, but is nevertheless slightly embarrassing). LISP comes with a built-in parser, which allows you to introduce grid examples with zero programming effort. After all, LISP is a very good language for rapid prototyping, and it would be a shame not to take advantage of this originality. 

Flow Grid LISP Exchange Format
We suggest to represent grids as lists of lists of elements of the same type (not necessarily the character type). In addition, we specify which element designates “empty”, and, optionally, which one designates a “bridge”. The syntax is thus:

     grid ::= (specifier matrix)

specifier ::=   (empty)
              | (empty bridge)

   matrix ::= ((e11 ... e1N)
                 ...
               (eM1 ... eMN))            

The elements of the matrix, likewise the empty and bridge specifiers, might be characters, or numbers, or whatever type, provided all have the same type. The flow-grid-examples.lisp file below contains an example using numbers, and an example using characters. Note that this file may be loaded in core using load function, just like any LISP file. Here are some examples in this syntax:

flow-grid-examples

You can comment above flow-grid-examples gdoc version of flow-grid-examples.lisp source file

Share your grids in LISP Exchange Format Folder



Comments