Puzzles and brain teasers
Number Puzzles
Sudoku has been popular for about 15 years, on paper as well as on computers. Available options include sudoku [9], KSudoku [10], and gnome-sudoku [11] (Figure 7). More puzzles and the means to create games can be found in the program Hitori (Figure 8) [12] [13] and Simon Tatham's portable puzzle collection (sgt-puzzles package) [14].
Solution Helpers
To help find the right answers and words to the puzzle questions, you have various resources at your disposal. On one hand, the online dictionaries already presented in the Free Thesauri article [15] and web resources such as OneAcross [16], Crossword Solver [17], Crossword Nexus [18], and Wordplays.com [19] are useful, as well as websites for synonyms and antonyms [20] [21]. These sites significantly simplify a search based on a puzzle question or term.
Incorporating Puzzles
As mentioned before, Qxw, CrossFire, and Klest-crossword can export your puzzles as PDFs or image files and allow you to incorporate them into other documents. The extensions crossword
, crosswrd
, cwpuzzle
, and sudoku
are available in the comprehensive TeX archive network (CTAN) for typesetting with LaTeX. Debian and Ubuntu users can find all extensions in texlive-games
[22].
Listing 1 shows a snippet of how you can set up a puzzle with the help of cwpuzzle
. First, import both color
and cwpuzzle
in lines 2 and 3, and then set a gray-shaded, borderless square in lines 7-14.
Listing 1
Constructing a Puzzle in LaTeX
In lines 16 and 17, you decide whether to output the empty puzzle or its solution – the empty puzzle is chosen here. Define the grid and the contents of the squares based on the environment puzzle in lines 19-25. Individual squares are separated using the pipe character, |
; curly brackets, {}
, indicate blank squares; and indices for a puzzle word are in square brackets, [<no>]
. If you add the detail [c]
, the color
definition in line 2 becomes important, and the corresponding square is highlighted in gray. Each line ends with a period.
Lines 27-32 and 34-36 set the puzzle questions. Each question consists of a brief description that helps the puzzler find the solution. Figure 9 shows the puzzles created by LaTeX. For further information – including how to create number puzzles – read the detailed documentation included with the package.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.