erobot.el --- game with elisp functions trying to survive

This game implements a very basic version of the many robot variants out there (eg. pRobot by Chris Rusche).

Players compete by writing a defun (called candidates or erobots). The last erobot remaining wins the game.

Here is a sample candidate:

(defun erobot-candidate-wanderer ()
  "A possible candidate for a game of `erobot'.
This candidate moves around in random directions."
  (list 'erobot-move (erobot-random-dir)))

In order to install, put the file somewhere on your `load-path' and add the following to your ~/.emacs file:

(autoload 'erobot "erobot" "Robots for Emacs, a game." t)

Calling erobot will prompt you for two candidates and run a game for you.

Erobot also has teams:

(defalias 'chaser-1 'erobot-candidate-chaser)
(defalias 'chaser-2 'erobot-candidate-chaser)
(defalias 'chaser-3 'erobot-candidate-chaser)
(erobot 'erobot-candidate-wicked-walker '(chaser-1 chaser-2 chaser-3))

Screenshot of the arena after four turns:

**************
*  A         *
*            *
*D           *
*B       C   *
**************
 4

You can run the same game as a tournament:

(erobot-run-tournament 'erobot-best-of-5
                       'erobot-candidate-wicked-walker
                       '(chaser-1 chaser-2 chaser-3))

Result of the tournament:

TOURNAMENT: BEST-OF-5

Score  Candidate

    3  chaser-2
    2  chaser-3
    1  erobot-candidate-wicked-walker
    1  chaser-1

Score  Team

    6  (chaser-1 chaser-2 chaser-3)

download erobot.el


Alex Schroeder <kensanata@yahoo.com> / updated: 2001-02-15 / significant changes: 2000-08-20