SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Sponsored Links

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

History

I enjoy hangman, and after an OS update, I found I'd lost my (crappy) text version of the game.

At Sunsite/Metalab/Ibiblio, I found Andreas's cute program. It wasn't very usable. Highlights include: Any switch of focus broke the algorithm, Every loop of the program reloaded the dictionary !!, and the letter entry widget was way small to be helpful.

( If you're reading this A., stop here, because your programming was pretty naive. Mega Highlights include: 11 comments for global variables - "# Globale Variablen", passing global variables aimlessly between procedures, heaps of redundant processing, and an algorithm from a place warmer than Austria. Still It is your program, without which I'd be playing the BSD console version. Thank-you. )

Status

Tkhangman has been totally recoded, has new pictures and words, and is is starting to feel quite finished. :-) ( Andreas' original program is included (in "extras") and can still be run.)

Version 2.5 is the first I've done in ages. I've made the entry widget quite robust, and given the look-n-feel an overhaul.

Wordlist

I've compiled an interesting/tricky wordlist. It has some Australian animal and plant names, as well as some scientific words.

Thanks

Humble thanks to Ibiblio archives, the author(s) of Tcl/Tk (awesome), real programmers writing code for linux/gnu and the companies that support them.

Changes

1/4/02 Remove LittlePicture widget, to make room for ...

        Align Entry and Points widgets vertically, not side by side
        Editing by the colour police
        Only initialize dictionary ('wordslist') once
        Added 'gameslost' and 'gameswon' variables
        Update widget before loading dictionary
        Fixed problem with focus (alt+cntl+'+|-', and TAB broke the algorithm)
7/4/02  Stopped letters pressed after Gameover running into next game.
        Fixed broken 'gameslost' algorithm.
13/4/02 Write small documentation.
        ----> 2.0 
2/6/02  Renamed procedures and variables and gave them better structure
        Added a check for already keyed letters
        Added a check for non-alphabetic characters
3/6/02  Don't load whole dictionary, but do a random file-seek and grab a word.
        Don't need to 'update' widget anymore
        Declare "/dev/kmem" upfront for ease of porting
4/6/02  Some string handling optimizations in InitWord
        ... adding these features, the speed loss was offset by
        optimizing the original code. Overall , seems faster ;-)
        Program is approaching a real version of around 0.9.
        ----> 2.2 

7/11/02 Drew some new gifs in my long lunch break. 8/11/02 Minor algorithm changes:

          'Start' button at start
          Change method of Image redraw
9/11/02 Renamed most of the widgets to something meaningful &
        Tidied up the !whole! program.
        Some elementary error checking on startup
        Slightly better installation notes
        New word list. ;->.
        ----> 2.4 
28/11/02Fixed padding so as picture has no spacing in a 1024x768 screen
        Hopefully is ok at higher resolutions too.
        ----> 2.4.1

22/12/02Rewrote random number generator 6/12/03 Gave the buttons a "groove" relief and changed the colours.

        Don't draw a border around the entry widget (upon focus).
        <FocusIn> the entry widget no longer highlights all the letters.
        Moving the cursor around (in the entry widget) no longer messes up.
        Changed the title label from text to a picture.
        ----> 2.5

9/12/03 a little code re-write
24/4/04 finally touched up the title gif

----> 2.5.1
Todo


        It's starting to look fairly finished... ~may~ think about:
        Better pictures-  Pictures of a cat instead of a person.
        A widget to select different dictionaries.
        - (But i don't think so. It's a nice size now)

Caveats

        Lower case input only.
        Extra big words don't fit.
        Capitalized words in the dictionary are made lower case.

Bugs

        Typing fast can cause letters to be skipped (on my k6-380).
        Please report any bugs to the author.

Author

Steven Atkinson (stevenaaus@netscape.net)


Sponsored Links

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.