{crossword}
A crossword made from a list of words: a numbered SVG grid with the Across and Down clues.
Syntax
{crossword} WORD: clue ... {/crossword}
{crossword solution, title='Name'} WORD: clue ... {/crossword}
Options
-
solution - Bare option: write the letters in the grid and the answers behind the clues.
-
title -
The grid's accessible name,
Crosswordwhen not given.
Description
{crossword} builds a crossword from a list of words. The content is a line per word, WORD: clue; it is taken as it stands, before the level walks it, so a clue may hold braces. Spaces, hyphens and apostrophes in a word are dropped - a word is letters only.
The words are laid out on the server across and down so they cross. The layout is greedy and the same every time: the longest word first, across; then each next word, longest first, where it crosses the most letters already placed on the smallest grid, never side by side with another word. A word that fits nowhere is left out and named under the clues. The squares are numbered row by row where a word starts, and each clue carries the length of its word.
The grid is an SVG drawn empty, ready to print, beside the Across and Down clues. With solution the letters are written in the grid and the answers behind the clues; title= names the grid.
Under the strict check the tag written alone, a line without a :, a word that is not letters, a word without a clue and a word written twice are errors. The colours are --pad-crossword-square, -line, -number, -letter and -answer on .pad-crossword.
Examples
Words and clues
Five words about PAD laid out as an empty grid with the clues beside it.
{crossword title='PAD crossword'}
TEMPLATE: The file that drives a PAD page
PIPE: The bar that hands a value to a function
ECHO: Writes a value
LEVEL: The scope a tag opens
IGNORE: Keeps braces from being read as tags
{/crossword}
Across
- Writes a value (4)
- The file that drives a PAD page (8)
Down
- Keeps braces from being read as tags (6)
- The scope a tag opens (5)
- The bar that hands a value to a function (4)
With the solution
The same words with solution - the letters in the grid and the answers behind the clues.
{crossword solution, title='PAD crossword, solved'}
TEMPLATE: The file that drives a PAD page
PIPE: The bar that hands a value to a function
ECHO: Writes a value
LEVEL: The scope a tag opens
IGNORE: Keeps braces from being read as tags
{/crossword}
Across
- Writes a value (4) ECHO
- The file that drives a PAD page (8) TEMPLATE
Down
- Keeps braces from being read as tags (6) IGNORE
- The scope a tag opens (5) LEVEL
- The bar that hands a value to a function (4) PIPE