Hey everybody,
Lately I have written the game Hangman in many different languages (C, JavaScript, Java and PHP so far). Here is the code snippet for JavaScript! It uses a words file, on the bottom of this post you will see a small example of a few words. The source code for other languages can be found here on DaniWeb and on my new website: .
You can adjust the words file in the initGame() function (line 81). The words need to be separated by a |. Words files can be found can be found here. By default, the images made by Symbol Webdesign will be used. If you want to change the imagesource, adjust the HTML part and also the showHangman() function. They need to be begin with 'hm', the error amount and then the extension (example: hm1.bmp).
~G
words.txt:
computer|radio|calculator|teacher|bureau|police|geometry|president|subject|country|enviroment|classroom|animals|province|month|politics|puzzle|instrument|kitchen|language|vampire|ghost|solution|service|software