#!/usr/bin/perl # You may need to change the above line to #!/usr/local/bin/perl ############################################################### # Hangman 1.3 # By J.R. Greer jrg@albedo.net # ftp://ftp.albedo.net/pub/games/html/ # http://www.albedo.net/pub/cgi-games.html # # game based on code by Nik Swoboda nswoboda@cs.indiana.edu # http://blackcat.brynmawr.edu/~nswoboda/prog-html.html # # cgi_receive routine loosely based on code developed at the # National Center for Supercomputing Applications (NCSA) at # the University of Illinois at Urbana-Champaign. # # (c) 1997,1998 all rights reserved # # The program is placed under the GNU Public License (GPL) # You may copy freely or modify the code in anyway as long # as the above information stays intact. # ################################################################# # Configuration # The Directory where the .gif files are ie: /game/hangman/image/ $GIF_DIR = "/game/image/"; # The cgi-bin dir and the name of the cgi ie: /cgi-bin/hangman.pl $CGI_BIN = "/cgi-bin/hangman.1.3.pl"; # the URL to go back to leave the game ie: http://www.albedo.net/ $HOMEP = "http://www.albedo.net/pub/cgi-games.html"; # The location of the word file $DATAFILE = "/usr/local/etc/httpd/cgi-bin/data/hangman.words"; # If the Clue stays on the screen $CLUE=1; $bgcolour="white"; $textcolour="#000010"; $linkcolour="blue"; $vlinkcolour="#FF00FF"; $alinkcolour="#FFFF00"; # use background $BG=0; $BGGIF="/game/image/bg.gif"; ################################################################## ################################################################### # Do not edit below this line ################################################################### &cgi_receive; if ($FINPUT{'word'}) { &p_head; $type = $FINPUT{'clue'}; $FINPUT{'word'} =~ y/a-x,y,z/c-z,a,b/; ### un-encrypt word if ($FINPUT{'done'} eq 'done') ### guessed the word { if ($FINPUT{'word'} eq $FINPUT{'new'}) ### get it right? { print "