Puzzles and brain teasers

Puzzling

Article from Issue 173/2015
Author(s):

Creating and solving letter and number puzzles is a popular pastime. We look at some of the free software that is available for this hobby on Linux.

Tricky puzzles, word games, and number problems are very popular – and not just in the depths of winter. The ability to apply yourself to a task and completely block out your surroundings is a distinctive personality trait for engineers, mathematicians, and other creative people. Scientific studies have demonstrated that puzzles provide mental stimulation and can even slow down the progression of Alzheimer's Disease [1].

If the original goal were just the pleasure of solving and cracking puzzles, it is now also considered a pastime with an intellectual benefit: brain training ("keeping your mind fit") and strengthening and increasing general knowledge. This is true both for creating the puzzle and finding a solution. In championships, the participant who solves the given puzzle in the quickest time is the victor.

Puzzle design varies in content, arrangement, shape, and size. Picture, syllable, crossword, and number puzzles are well-known examples. The solutions can often be discovered with the help of logical thought processes or graph theory (e.g., the famous number squares, Sudoku).

Puzzle Variants

Crossword puzzles first came to the United States at the beginning of the 20th century as part of daily newspapers and celebrated their debut in Europe soon afterward [2]. Matrixes, crosswords, and other word puzzles are examples of variants with letters. Puzzles that use digits are called combinatorial or logic puzzles. Although the number puzzle Sudoku is copyrighted in Japan, all the puzzles referred to here are usable worldwide without restriction.

Word puzzles comprise fields or squares in which individual letters are entered to form complete words, depending on the direction they are read. The arrangement of fields and terms can be horizontal, vertical, diagonal, or in a circle as marked. Sometimes additional criteria must be observed, such as the frequency of individual characters or the overlapping of individual letters or whole syllables. Terms are demarcated either by blank fields, integrated pictures, blocks, thick lines, boundaries, colored highlights, or the arrangement or design of individual fields.

Designing Puzzles

Puzzles were initially created manually, and this practice is still common, but since the 1980s the manual method has increasingly been replaced with more automated approaches. The size, shape, and number of blank fields are entered as parameters; then, completion helpers and solution generators can help find the appropriate terms for empty fields (see the box "Rules by Which Puzzles Are Created").

Rules by Which Puzzles Are Created

The conventions that determine the appearance of a crossword puzzle vary from country to country. Whereas symmetries and unusual arrangements are particularly valued in the UK and the US, the classic rectangle is common in Germany. In addition to the size and shape, the relationship of blank fields to letter fields plays a major role – 1:4 is common. The terms and questions are guided by the publication and often include general knowledge, personalities from science and technology, geographic names, and industry-specific terms.

Up to now, the list of software for Linux has always been fairly easy to keep track of. The top dog is the X11-based Qxw, followed by CrossFire, the XWICKED crossword editor (xwce) [3], and Klest-crossword.

Qxw

Qxw [4] is available in the form of the qxw package for Debian and Ubuntu. Initially, the Gtk-based program starts with empty fields that you fill with letters. You determine the starting position and the direction to fill by clicking the gray triangle – horizontal, vertical, or diagonal depending on the puzzle shape. You can see the words that fit on the selected position in the grid in the list on the right side. Qxw prefers long sequences of letters to minimize the number of blank fields or word separators, and updates the list depending on positions and entries. You can add word separators in front of or to the left of the respective position using the Enter key.

Qxw is configurable, providing various versions of rectangles, circles, and honeycombs. You choose the shape and size under Properties | Grid properties, where you set the style and number of blank fields. The Symmetry menu item lets you select among a number of rotational and mirroring symmetries, with or without duplication. Qxw analyzes the file /usr/share/dict/words for the Feasible words list, and you can add more lists of terms if you like under the menu item Autofill | Dictionaries.

To fill a grid automatically, set up some delimiting bars in the Edit menu, then choose Autofill | Autofill (Figure 1). Of course, Qxw might not be able to provide a complete result, so you will have to create the puzzle manually. Figure 2 shows a completed 10x10 puzzle exported as a pixel image.

Figure 1: Qxw with AutoFill.
Figure 2: A puzzle generated by Qxw.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News