Question

I've continued messing with the ZOMBIE esoteric language, and the interpreter I've been using is throwing some errors.

The interpreter is here: http://esolangs.org/wiki/User:Marinus/ZOMBIE_interpreter

The specification is here: http://www.dangermouse.net/esoteric/zombie.html

I am using Terminal on a Mac. When I run the Hello World program though the interpreter,

HelloWorld is a zombie
summon
task SayHello
    say "Hello World!"
animate
animate

Terminal says-

HelloWorld is a zombie
                     ^
SyntaxError: invalid syntax

I believe there is a problem with the syntax-recognizing regular expressions in the interpreter, but I have no experience with them. Here is the code I believe is to blame:

comment_re = re.compile("\{.*?\}", re.DOTALL)
declaration_re = re.compile(r'([A-Za-z0-9_\-]*?)\s+is\s+an?\s+(zombie|enslaved undead|' + \
                        r'ghost|restless undead|vampire|free-willed undead' + \
                        r'|demon|djinn)', re.I)

task_re = re.compile("task\s+([A-Za-z0-9_-]*)", re.I)
remember_re = re.compile("remember\s+(.*)", re.I)

string_re = re.compile('".*?"')
integer_re = re.compile('[\-0-9\.]+')

Sorry I can't be more specific... any help would be much appreciated.

Was it helpful?

Solution

It works just fine for me:

temp $ python zombie.py zombie.z 
Hello World!

I copied the source of the interpretter directly from the link you posted for the interpreter and saved it as zombie.py in the current directory (~/temp, although that's irrelevant). Then I copied the source of the zombie HelloWorld program directly from your post and saved it as zombie.z (again in the current directory). It prints Hello World! as I'm assuming it is supposed to...

(python2.7, Mac OS X 10.5.8)

The SyntaxError leads me to believe that you're trying to run the zombie.z (or whatever you called it) from python directly e.g. python zombie.z or something like that ... That won't work.


As an aside, I think it's interesting that both myself and the poster from your previous question (independently) choose .z as the extension of zombie source files. Must just be the natural choice...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top