http://www.crummy.com/devel/WhatFools/
--
: Dylan O'Donnell http://www.spod-central.org/~psmith/ :
: "Any sufficiently arcane magic is indistinguishable from technology." :
: -- Lebling's Inversion of Clarke's Third Law :
Love it! I wonder if he's working on the long awaited "Nethack:
Inventory Management", the game which does away with all the boring parts
of Nethack that you have to slog through, like fighting, praying, quaffing,
etc., and lets you get right to the meat of the game: inventory management!
I'm picturing something like this...
Your hero has found an orcish dagger. (t)ake or (l)eave?
t
g - an orcish dagger
Your hero says, "I don't think I want this leather armor any more."
(t)ake or (d)rop?
d
Your hero says, "Hey, what do we have that's good against gelatinous
cubes?" (u)se, (d)rop, (h)and over item, or (r)efuse?
h r
You hand over a wand of fire.
Oops! Your hero just bit the dust. Do you want his possessions identified?
--
If mail to me bounces, try removing the "+STRING" part of the address.
Ha! This looks great! The only trouble is, I can't figure out how to play
it. I just installed Python 2.2.2 for Windows and tried to run the script,
but I get errors about GetchUnix() and termios. Does this only work on
Unix? What am I doing wrong?
Michael
Traceback (most recent call last):
File "\unzip\whatfools-1.0\whatfools.py", line 187, in ?
getch = _Getch()
File "\unzip\whatfools-1.0\whatfools.py", line 154, in __init__
self.impl = _GetchUnix()
File "\unzip\whatfools-1.0\whatfools.py", line 160, in __init__
import tty, sys
File "C:\PROGRAM FILES\PYTHON\lib\tty.py", line 5, in ?
from termios import *
ImportError: No module named termios
> > http://www.crummy.com/devel/WhatFools/
> Ha! This looks great! The only trouble is, I can't figure out how to
> play it. I just installed Python 2.2.2 for Windows and tried to run
> the script, but I get errors about GetchUnix() and termios. Does this
> only work on Unix? What am I doing wrong?
I had the same problem, but it was fairly easy to comment out the
offending portions. I'm still not sure whether this was supposed to work
out of the box or my Python install is mucked up.
--- WhatFools.py.orig Mon May 19 02:56:28 2003
+++ WhatFools.py Mon Jun 09 14:33:07 2003
@@ -151,38 +151,39 @@
try:
self.impl = _GetchWindows()
except ImportError: pass
- self.impl = _GetchUnix()
+ # self.impl = _GetchUnix()
def __call__(self): return self.impl()
-class _GetchUnix:
- def __init__(self):
- import tty, sys
+#class _GetchUnix:
+# def __init__(self):
+# import tty, sys
+#
+# def __call__(self):
+# import sys, tty, termios
+# if hasattr(termios, 'TCSADRAIN'):
+# iomod = termios
+# else:
+# import TERMIOS
+# iomod = TERMIOS
+#
+# fd = sys.stdin.fileno()
+# old_settings = termios.tcgetattr(fd)
+# try:
+# tty.setraw(sys.stdin.fileno())
+# ch = sys.stdin.read(1)
+# finally:
+# termios.tcsetattr(fd, iomod.TCSADRAIN, old_settings)
+# return ch
- def __call__(self):
- import sys, tty, termios
- if hasattr(termios, 'TCSADRAIN'):
- iomod = termios
- else:
- import TERMIOS
- iomod = TERMIOS
-
- fd = sys.stdin.fileno()
- old_settings = termios.tcgetattr(fd)
- try:
- tty.setraw(sys.stdin.fileno())
- ch = sys.stdin.read(1)
- finally:
- termios.tcsetattr(fd, iomod.TCSADRAIN, old_settings)
- return ch
class _GetchWindows:
def __init__(self):
import msvcrt
- def __call__(self):
- import msvcrt
- return msvcrt.getch()
+ def __call__(self):
+ import msvcrt
+ return msvcrt.getch()
getch = _Getch()
------------------------------------------------------X
--
Darshan Shaligram dars...@aztec.soft.net
> I had the same problem, but it was fairly easy to comment out the
> offending portions. I'm still not sure whether this was supposed to work
> out of the box or my Python install is mucked up.
[patch snipped]
Thanks Darshan. I love this game! I spent an hour or two playing around
with Python and managed to create a Win32 executable. It's about 500K to
download, but at least it's smaller than the Python interpreter.
> http://www.crummy.com/devel/WhatFools/
OK, my hero dies quite fequently. Very very funny, but one peculiar
question is still on my mind: is it really possible to help him to get
the amulet, or this is completely randomized?
rekrutacja
Having looked at the source, I can say with some certainty that your
actions do affect your champion's chances. However, (s)he is a very
good simulation of the average NetHack player so an ascension really
takes patience. (More than I have, but it's a cute idea and fun for
the few minutes it lasts.)
--
++acr@,ka"
> > OK, my hero dies quite fequently. Very very funny, but one peculiar
> > question is still on my mind: is it really possible to help him to
> > get the amulet, or this is completely randomized?
> Having looked at the source, I can say with some certainty that your
> actions do affect your champion's chances. However, (s)he is a very
> good simulation of the average NetHack player so an ascension really
> takes patience.
If you're desperate to see an ascension, you can always start off your
chosen one in discovery mode.
--
Darshan Shaligram dars...@aztec.soft.net