Examples

This page contains a couple of example scripts written in Arena. These should serve to give an impression of how Arena scripts look and feel like. Source code for each example can be downloaded and also viewed as HTML.

Your help is needed in making this section grow! If you have written a small Arena script that illustrates some part of the language or shows how to solve a common problem in Arena, please consider sending it to the maintainer for inclusion here.

Games

This section contains a couple of examples of console-based games written in Arena.

guess (source)
is a primitive number guessing game written by Pascal Schmidt.
tictactoe (source)
is an implementation of a two-player Tic Tac Toe game written by Pascal Schmidt.
venture (source)
is a port of a text-based adventure games originally written in Sinclair Basic for the Spectrum computer. This version was ported from a 4tH implementation by Hans Bezemer.
23match (source)
is a game of drawing matches ported by Hans Bezemer.
lander (source)
is a variant of the famous Lunar Lander game ported by Hans Bezemer.
ttt (source)
is a single player version of Tic Tac Toe ported from 4tH by Hans Bezemer. The implementation is radically different from the two player version found above.

Tools

This section contains more or less useful command-line tools.

strfreq (source)
is a command line tool that prints out the frequency of different letters in an input word. It was written by Pascal Schmidt.
dc (source)
is an implementation of the dc desk calculator program written by Hans Bezemer.
bf (source)
is an implementation of an interpreter for the Brainfuck language written by Hans Bezemer.
wc (source)
is an implementation of the Unix word count utility written by Alistair Crooks.
markov (source)
is a Markov chain text-garbling program (Disassociated Press, anyone?) written by Sander van Dijk.

Foreign Functions

This section contains examples for using the foreign function interface to call external C code.

ffi_pcre (source)
is an example of interfacing to the PCRE library via dynamic library loading and foreign function calls.