Developer's Guide to KHangMan

Chapter 4. Developer's Guide to KHangMan

How to change the words for the game

Download the tar.gz file of the latest version of KHangMan. Unpack it in a directory (/usr/local/bin for example). The words are stored in 4 separate files, one for each level. The files are in /khangman/data. The file easy.txt is for level easy, the file level2.txt is for level medium, the file level3.txt is for level animals and the file level4.txt is for level hard.

Edit one of the file with your favorite editor (e.g. KEdit or Kate or Emacs). Change the words by putting one word a line, the maximum letters in the word should be 12.

Note

The 4 text files have each 44 words (that is 44 lines with a word per line). If you change that number, please do so for each of these files so they all have the same number of lines/words. Then, in khangman.cpp, correct the first int that is declared which is called wordsnum.

int wordsnum=your_new_number_of_words;

Save the file and do a make install as root to install the file correctly if you already compiled the game. If not, ./configure --prefix=$KDEDIR, make and make install in a terminal.

KDE Logo