Hangman Program

8 views
Skip to first unread message

Neil Hatan

unread,
Mar 31, 2009, 7:16:41 PM3/31/09
to Leeds ASchool
Following today's meeting I have completed a version of the Hangman
program for people to look at. The program does the following:

User input is checked so that only alphbetic characters are accepted,
and where more than one alphabetic character is entered only the fist
one is accepted.
Rejects or rather ignores duplicate letters/guesses
Produces a basic output showing guessed and remaining letters
Counts remaining letters to be guessed and uses this and the number of
lives to keep the user inside the text entry loop
Gives users feedback at the end ( and tells you the word if you don't
win.

Clearly the program leaves a lot to be changed:
Text file of words with one chosen at random
Better formatting
A hangman style graphic rather than simply retuning the lives left

I have had a few ideas for how some of the lines of code could be
introduced via some interactive activities using IDLE - I will post
later

Any comments would be appreciated

This version has no comments - homework is to try and work out the
basic blocks!

Neil Hatan

unread,
Mar 31, 2009, 7:18:29 PM3/31/09
to Leeds ASchool
Sorry - Look in the Files section for the hangman py file

Hoole, M

unread,
Apr 1, 2009, 3:00:15 AM4/1/09
to leeds-...@googlegroups.com
That’s great! You’ve done a sterling job with this – it looks a lot more user friendly, even without the comments.

Regards,
  
Michelle Hoole
ICT Teacher Advisor
Learning Communities Team
School Improvement Service
Education Leeds
Derek Fatchett CLC
Bedford Field,
Woodhouse Cliff,
Leeds, LS6 2LG
  
Telephone: (0113) 288 3540
Fax: (0113) 288 3541
Email: hool...@leedslearning.net




From: Neil Hatan <hatta...@leedslearning.net>
Reply-To: <leeds-...@googlegroups.com>
Date: Wed, 1 Apr 2009 00:16:41 +0100
To: Leeds ASchool <leeds-...@googlegroups.com>
Subject: [leeds-aschool] Hangman Program
This message has been processed by MIMESweeper for Exchange.


Aylward, J

unread,
Apr 1, 2009, 3:44:57 AM4/1/09
to leeds-...@googlegroups.com
well done Neil - burning the midnight oil eh!
J Aylward
ICT Coordinator
Royds Language College
________________________________________
From: leeds-...@googlegroups.com [leeds-...@googlegroups.com] On Behalf Of Neil Hatan [hatta...@leedslearning.net]
Sent: 01 April 2009 00:18
To: Leeds ASchool
Subject: [leeds-aschool] Re: Hangman Program

Tony Jenkins

unread,
Apr 1, 2009, 7:00:56 AM4/1/09
to leeds-...@googlegroups.com

Looking at this example, I was wondering whether it could be used to show
the decomposition of a problem as well as programming concepts.

I've uploaded my attempt to the files area. There are some quite nice little
problems in there, which I've coded as separate functions.

I think my rules are the same as Neil's. My logic is a bit different: I just
keep the word and the guessed letters, and use functions to provide the
appropriate display. I've no graphics, but I do have a very simple way to
pick a random word.

Cheers,

Tony
--
This Space to Rent.

Neil Hatan

unread,
Apr 1, 2009, 12:04:31 PM4/1/09
to Leeds ASchool
Thanks for the feedback - I will have a look at this pronto

I should point out that the game I have written is VERY much a
prototype. We discussed at our teachers meeting how this could be
broken down into more steps. I am working on this as we speak; this
should make it more manageble for Year 7 pupils. Thanks for the ideas
on picking a random word - this was something for the next incarnation
of the program (although I would like to try and read values from a
text file to get some file handling ideas into the program.)

After our meeting on the 31 March I felt that it would help everyone
concerned if I could get at least a basic functioning program up and
running. I like the idea of using functions - so I may well develop
the idea further - after all the pupils will need to have some grasp
of the benefits of functions for improving the efficiency and
understanding of the main part of the routine.
> This Space to Rent.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages