examples of CGI "games" with Python

Erik Max Francis max at alcyone.com
Thu Dec 12 20:52:24 EST 2002


Will Stuyvesant wrote:

> As a fun project I would like to write a game: a simple version of
> nethack.  Or a simple strategy/civilization thing.  The idea is that
> the user only has to point a browser to a website.  On the website url
> there is a CGI script that presents the user with a small part of the
> map and a few buttons for commands etc.  The webpage presented to the
> user preferably has to "refresh" automatically every 30 seconds or so
> if the user does not issue commands during the 30 seconds.  This is
> possible using some HTML pragma but I can not find an example.

There is a no-cache pragma, and there's also the trick of specifying an
expiration date in the past.  They're both, as far as I know,
non-standard extensions, but they're widely supported.

The problem is that with a highly-interactive game like Nethack or
Empire or something similar, pure CGI is an awkward way to go.  It's
much more suitable for games where there is fairly low interactivity,
but if it's a game where there are inherently a lot of
clicks/keypresses, playing via CGI is going to be nightmare.  Imagine
playing Nethack and -- even in the best case -- having to wait a few
seconds for _each and every_ move.

These are examples of games where a client-side applet would really make
a lot more sense.

> As an extra challenge: on the serversite it is a Silicon Graphics
> machine running IRIX with Python 1.4 and 1.5 installed, and I have no
> permission to install a higher Python version and the sysadmin does
> not want it either.

Interesting problem; what is his motivation?  It can be that he thinks
it's a security risk, since Python is already there.  What is it, just
laziness and/or stubbornness?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ There is _never_ no hope left.  Remember.
\__/ Louis Wu
    Erik Max Francis' bookmarks / http://www.alcyone.com/max/links/
 A highly categorized list of Web links.



More information about the Python-list mailing list