PAD, a text adventure language written in D

downs default_357-line at yahoo.de
Thu Nov 5 09:27:02 PST 2009


This was originally created for my IRC bot, but I added a CGI interface a few days ago.

Here's a quick demo: http://demented.no-ip.org/~feep/pad_test.cgi?prev=eJzLL0jNU8goKSmw0tcvSCwuSU3KzNNLzs%2FVzzVKtky0MDFJBQDYDgu%2B

It takes pastebin.com/ca/paste.dprogramming.com pages, Dokuwiki pages and raw text. For other sites, you have to wrap the code between %PAD START% and %PAD END%.

Source is on http://dsource.org/projects/scrapple/browser/trunk/idc/pad

The source is a simplicist imperative language based around the concept of scopes.

A scope is a named entity that contains other scopes or commands in a defined order. It can also have a value. Scopes unify functions and variables in a single concept.

Evaluating a scope evaluates all contained commands in order, unless it has a "default" scope, in which case that is evaluated instead.

"area scopes", scopes prepended with "area", form the rooms of the game. The player is always in a "current room", accessible via the keyword 'location'.

"hidden scopes", prepended with "#", cannot be accessed by the user directly.

"global scopes", prepended with global, when included below the root scope are always accessible by the player regardless of other lookup rules. "inventory" is a typical global scope.

Most of the commands _should_ (well, might) be self-explanatory. Have fun, and feel free to ask back.


More information about the Digitalmars-d-announce mailing list