Python IRC Zork

Erik Max Francis max at alcyone.com
Thu Feb 28 04:50:36 EST 2008


Kris Davidson wrote:

> If this has been done before in another language could someone please
> tell me, if not I was wondering is its possible and what the easier
> way is to create an IRC bot that allows you to play Zork:
> 
> I was thinking of just creating a simple Python IRC bot or finding an
> existing one then have it run Zork and read/write from stdout/stdin.
> 
> Is that possible? Is there a better or easier way to do it? Are there
> any existing programs that do something similar?
> 
> Or just really anything else people have to say on the subject.

The easiest way would be to start with a standalone Z-code interpreter 
that does just basic stdin/stdout transactions, get a licensed copy of 
the Zork data set, and hook it up via a subprocess -- in other words, 
just what you suggest.  I haven't done recent surveys, but there are 
_many_ portable Z machine interpreters such that I'm sure one or two 
would suffice.  (You'd also have to play buffering/fcntl games to make 
sure that it doesn't block, but those are in the details.)

The bigger picture would be writing a full Z machine in Python, which is 
something I embarked on for my own amusement a while back but never got 
far enough to do anything useful at all, given the size of the task.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
   Wyrd has swept all my kin / all the brave chiefs away! / Now I must
    follow them! -- Beowulf



More information about the Python-list mailing list