#!/usr/bin/perl # You may need to change the above line to #!/usr/local/bin/perl # Do not edit this file in Windows!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # this file MUST be saved in a UNIX file format!!!!!!!!!!!!!!!! ############################################################### # Hangman 1.3.4 # By J.R. Greer jrg@albedo.net # (c) 1997,1998,1999,2000,2001 # ftp://trillian.bbs42.com/pub/games/hamgman/ # 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.4.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 (FULL HARD DRIVE PATH! NOT HTML URL!!!!!!!) $DATAFILE = "/usr/local/etc/httpd/cgi-bin/data/hangman.words"; # This line is to filter 0x0D from the word file to prevent poblems # with word files done in Notepad or Word $DATAFILE =~ s/\r//g; # 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"; ##################################################################### # The following options require write permission for the html server # You must use FULL PATH NAMES, # Write anticheat file # this writes the IP and guess number of the user to prevent cheating $wac=1; $wacfile="/httpd/htdocs/game/hangwac"; $ctlfile="/httpd/htdocs/game/hangctl"; # # Turn on scoreing $score=1; # # top ten players list; (not working) $ttpl="/httpd/htdocs/game/ttpl.html"; ################################################################### ################################################################### # Do not edit below this line # (Well unless you know what You are doing ;-) ################################################################### $VER="1.3.4"; ############# # Read input into array &cgi_receive; ############# ($win,$streak) = split (',',$FINPUT{'wlt'}); # now test to see if this is the first time through if ($FINPUT{'word'}) { &p_head; $type = $FINPUT{'clue'}; ### un-encrypt word $FINPUT{'word'} =~ y/a-s,t,u,v,w,x,y,z/h-z,b,a,f,e,d,c,g/; $ctlnum=$FINPUT{'control'}; $score=$FINPUT{'score'}; $gn=$FINPUT{'gn'}; if ($wac == 1){ &read_wac; } if ($FINPUT{'done'} eq 'done') ### guessed the word { $BG = $FINPUT{'new'}; $BG =~ y/A-Z/a-z/; $BW = $FINPUT{'word'}; $BW =~ y/A-Z/a-z/; if ($BW eq $BG) ### get it right? { print "