[Kc] FW: Perl Quiz-of-the-Week #17 (hangman)

David Dumler DDumler at jccc.net
Wed Aug 11 09:06:32 CDT 2004


If your son is interested in game programming he should look at GLOP -- GAME
LANGUAGE OF PERL.  I went to a session on it at OSCON -- it is still a work
in progress, but it looks pretty cool so far.  As of 2 weeks ago it was not
yet available on CPAN, but you can get it from sourceforge.

-David D.

-----Original Message-----
From: kc-bounces at mail.pm.org [mailto:kc-bounces at mail.pm.org]On Behalf Of
Doug Ledbetter


At 08:00 AM 5/26/2004, you wrote:

>From: mjd at plover.com [<mailto:mjd at plover.com>mailto:mjd at plover.com] On 
>Behalf Of Marco Baringer
>Sent: Wednesday, May 26, 2004 6:48 AM
>To: perl-qotw at plover.com
>Subject: Perl Quiz-of-the-Week #17 [x-adr]
>
>IMPORTANT: Please do not post solutions, hints, or other spoilers
>         until at least 60 hours after the date of this message.
>         Thanks.
>
>
>The Game of Hangman
>--------------------




Has it been 60 hours yet?  ;)

I sat on this one for quite awhile until I decided to use it to help my 15 
year old expand his programming skills.  He's writing this in Dark Basic 
but I hacked it out in Perl.  I'm finished.  He's not.  :)

I'm sure my code isn't the most efficient way of doing this, but I was 
mostly focusing on making the code readable.  My son doesn't know Perl, but 
I hoped that my code would be easy enough to read that he could use it when 
he gets stuck in his Dark Basic coding.

I have attached both the script "hangman.pl" and a dictionary "words.zip" 
if you don't have your own dictionary.  Usage is explained by running the 
script without arguments.

Comments and suggestions are welcomed.  I've done a fair bit of Perl 
coding, but this is my first Perl game (possibly my last?).  Most of my 
coding experience is either web related or system administration related.

One thing I've noticed with my son is that he wants to sit down and write a 
graphical Real Time Strategy (RTS) game (ie- Age of the Empires) before 
doing any of the more simple and practical things first.  Unfortunately, he 
doesn't have the skills it would take to do a complex graphical game yet.

When I was his age, I had a TRS-80 and taught myself BASIC.  There weren't 
any slick RTS or 3D games for the thing.  The skill level required to write 
an amusing game on the TRS-80 or Apple IIe was much lower.  He's been 
working on this hangman game, but he's really not very interested in 
it.  He doesn't see the benefit of this text-based game as a building block 
toward bigger & better things in the future.  He thinks he wants to be a 
game developer, but with his unwillingness to learn the basics of 
programming (loops, data structures, etc. -- all the things that aren't 
much fun), I'm really not sure if he's cut out to be a programmer.  Anybody 
else have similar experiences?

-dougl



____________________________________________________________

Doug Ledbetter -- Hagen Software, Inc.
dougl at dougledbetter.org
My PGP Public Key: http://dougledbetter.org/public_key.html


More information about the kc mailing list