What Fools These Mortals

37 views
Skip to first unread message

Dylan O'Donnell

unread,
Jun 9, 2003, 6:45:20 AM6/9/03
to
Leonard Richardson ("robotfindskitten", "Guess the Verb!") hasn't been
along to announce this here, so I may as well point people at it:

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 :

Jeremiah DeWitt Weiner

unread,
Jun 9, 2003, 12:45:29 PM6/9/03
to
Dylan O'Donnell <psmit...@spod-central.org> wrote:
> Leonard Richardson ("robotfindskitten", "Guess the Verb!") hasn't been
> along to announce this here, so I may as well point people at it:
> http://www.crummy.com/devel/WhatFools/

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.

Michael Lehotay

unread,
Jun 9, 2003, 12:45:52 PM6/9/03
to
On Mon, 9 Jun 2003, Dylan O'Donnell wrote:
> Leonard Richardson ("robotfindskitten", "Guess the Verb!") hasn't been
> along to announce this here, so I may as well point people at it:
>
> 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?

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

Darshan Shaligram

unread,
Jun 9, 2003, 1:01:54 PM6/9/03
to
Michael Lehotay <mleh...@hotmail.com> writes:
> On Mon, 9 Jun 2003, Dylan O'Donnell wrote:
> > Leonard Richardson ("robotfindskitten", "Guess the Verb!") hasn't been
> > along to announce this here, so I may as well point people at it:

> > 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

Michael Lehotay

unread,
Jun 9, 2003, 7:26:46 PM6/9/03
to
On Mon, 9 Jun 2003, Darshan Shaligram wrote:
> Michael Lehotay <mleh...@hotmail.com> writes:
> > On Mon, 9 Jun 2003, Dylan O'Donnell wrote:
> > > Leonard Richardson ("robotfindskitten", "Guess the Verb!") hasn't been
> > > along to announce this here, so I may as well point people at it:
>
> > > http://www.crummy.com/devel/WhatFools/
>
> > I just installed Python 2.2.2 for Windows and tried to run the script,
> > but I get errors about GetchUnix() and termios.

> 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://post.queensu.ca/~lehotay/WhatFools-1.0.zip

rekrutacja

unread,
Jun 11, 2003, 9:26:20 AM6/11/03
to
On 6/9/2003 12:45 PM, Dylan O'Donnell wrote:

> 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

Sam Dennis

unread,
Jun 11, 2003, 9:32:09 AM6/11/03
to

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"

Darshan Shaligram

unread,
Jun 11, 2003, 10:42:59 AM6/11/03
to
Sam Dennis <s...@malfunction.screaming.net> writes:
> rekrutacja wrote:
> > On 6/9/2003 12:45 PM, Dylan O'Donnell wrote:
> >> 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?

> 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

Reply all
Reply to author
Forward
0 new messages