Computing: Free Pascal Programming

"Guess the word" game II.

Download WGuess2 desktop application (Windows 64bit) Download WGuess2 source code (Lazarus/Free Pascal)

Description: The aim of this game is to guess a word displayed as a series of hyphens, each hyphen representing 1 character. Guesses are done by hitting a letter on the keyboard. If the word actually contains this letter, it is displayed at the corresponding positions (if you think to know what the word is, you can use the Solve button to enter it directly as a whole). For each wrong attempt, one part of a 10-parts gallows is constructed; the word has to be found before the gallows is complete.
The game is intended for 2 players, who play in alternate turns. 2 methods of scoring (that may be selected in the Settings menu) are possible: 1. By words found: each word found gives 1 point, each complete gallows gives 1 point to the adversary; 2. by trials compare: the player, who finds her word with the fewest attempts wins and the number of points she earns is the difference of the 2 players' number of trials.
The program chooses the words from a file, which may be chosen by the user. 4 files with words in English, French, German resp. Luxembourgish are included. To use your own word list, just create a text file, containing the words you want, 1 word per line.

Programming note: I wrote this program, starting form the code of my WGuess application from mid-2017, one of the first GUI applications that I wrote. Lots of code improvements would imposeā€¦

Free Pascal features: Catching keyboard events. Dealing with UTF-8 characters and strings. Usage of string grids. Reading text files (classic Pascal).


Educational PC application: Guess the word game with gallows