Jind - an interpreter for a toy programming language ==================================================== 1) Introduction =============== Jind is a simple interpreter. You can give instructions in textual form to a person lost in a labyrinth. Loops and conditional instructions help you to formulate a quite general solution. 2) Installation =============== You need a compiler for Java. Do cd jind-1.0 make to compile Jind. Open the file "jind.html" in any browser supporting Java applets. 3) Description of the language ============================== Jind is very easy to learn. There are three basic movements the person in the labyrinth can perform: goahead - make one step forward (i.e., the direction we are looking) turnright - turn to the right turnleft - turn to the left There are also conditions. The labyrinth consists of two kinds of things: free places and blocks. You can say if freeahead goahead endif or: if blockahead turnright turnleft turnright else goahead endif The structure of conditional instructions is if () ( ... ) else () ( ... ) endif the else-part is not mandatory, but the "endif" is. IFs can be nested to an arbitrary extent: if blockright if blockahead turnleft endif endif All in all, there are 6 things that we can check for: blockright blockleft blockahead freeright freeleft freeahead There are also loops: until () ( ... ) enduntil For example: until blockahead goahead enduntil or: until freeright turnright turnright enduntil Loops and IFs can be mutually nested to an arbitrary extent. The construction until target () ( ... ) enduntil loops over until the person has arrived at the exit. The game is over when no more instructions are available or when the person bumps into a block. Each statement must occur on a separate line. Whitespace does not matter. A line that begins with "#" is treated as a comment, i.e. it is ignored. 4) Aim of the game ================== The aim of the game is to lead the person out of the labyrinth. A red spot marks the exit. You should formulate a general solution. You can take for granted that the exit always remains on the border of the labyrinth. Therefore, you just have to give your instructions in such a way that the person always has a block right to her. Eventually, she will arrive at the exit with this strategy. 5) Latest version and contact ============================= The latest version of Jind will be available from http://www.freshmeat.net Good luck! Markus Triska (triska@gmx.at).