Installation | Basic Usage | Settings | Puzzle Object | License | Support | Donate
A Javascript app for solving acrostics in a browser.
- View demo here
- Easy install and set-up
- Requires jQuery 3.5.x or higher
- Seems to work in most browsers (tested on Chrome/Firefox on Win/Mac/iOS; Edge on Win; Safari on Mac/iOS; NOT tested on Android)
- Generally responsive; keyboard, mouse, touch
- Auto-saves solver's progress
- End-user preferences for colors and auto-checking
Installation
Download latest version here (v1.0.2, January 2021)
Stylesheet<link rel="stylesheet" type="text/css" href="/path/to/mfacrostic.css">
Scripts
<script src="/path/to/jquery-3.5.1.min.js"></script>
<script src="/path/to/mfacrostic.js"></script>
Optional; may improve mobile browser experience (add to <head>)
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Basic Usage
$(element).mfAcrostic({...settings});
Create acrostic after document loaded/ready. For example, using a jQuery "ready" function:
$(function() {
$("#my-acrostic-container").mfAcrostic({
puzzle: '/path/to/MyAcrostic.json',
print: '/path/to/MyAcrostic.pdf',
solution: '/path/to/MyAcrostic_Solution.pdf',
maxCols: 30,
hideHeader: true,
});
});
NOTE: More than one mfAcrostic per web page has not been well-tested.
Settings
Key | Description | Type | Default | Examples |
---|---|---|---|---|
puzzle |
REQUIRED* URL or path to puzzle JSON file; or a valid puzzle object. |
String or Object | * |
puzzle: '/path/puz.json' puzzle: {...puz_object}
|
URL or path for link to printable puzzle (pdf, png, etc.). | String | null |
print: '/path/puz.pdf'
|
|
solution | URL or path for link to printable puzzle solution (pdf, png, etc.). | String | null |
solution: '/path/puz_solution.pdf'
|
defaultEm | Base font size in pixels. Minimum of 16 is highly recommended to prevent auto-zooming in certain browsers. | Integer | 18 |
defaultEm: 21
|
maxCols | Maximum number of grid columns. | Integer | null |
maxCols: 30
|
minWidth | Minimum app width in pixels. | Integer | 240 |
minWindowWidth: 500
|
maxWidth | Maximum app width in pixels. | Integer | null |
minWindowWidth: 1190
|
hideHeader | Hide title, constructor, date above puzzle. | Boolean | false |
hideHeader: true
|
showGridPad | Show trailing black squares on grids. Valid values are 'none', 'all', 'author', or 'grid'. | String | 'grid' |
showGridPad: 'none' showGridPad: 'all' showGridPad: 'author' showGridPad: 'grid' |
colorScheme | Default color scheme for game board. | String | 'mfa-colors-default' |
colorScheme: 'mfa-colors-pastels'
|
disableStorage | Disables saves of app progress/settings to localStorage. | Boolean | false |
disableStorage: true
|
disableAutoFocus | Disables auto-focus on game board when puzzle loads. | Boolean | false |
disableAutoFocus: true
|
Puzzle Object
The mfAcrostic app creates a new puzzle instance from a puzzle object with its own compact, proprietary format. The object may be passed into the app either inline or in a JSON file (see the puzzle
key in Settings).
Example of a puzzle object
{
"title": "Acrostic 136",
"constructor": "Dave Murchie",
"publishDate": "2020-12-28",
"friendlyauthor": "A.A. Milne, \"Not That It Matters\"",
"friendlyquote": "Almost anyone can be an author; the business is to collect money and fame from this state of being.",
"quote": "ALMOST ANYONE CAN BE AN AUTHOR THE BUSINESS IS TO COLLECT MONEY AND FAME FROM THIS STATE OF BEING",
"clues": [
{
"clue": "\"I agree completely!\"", // Labelled as clue 'A.' in the app
"answer": [
"7", // A, the 8th letter in 'quote'
"58", // M, the 59th letter in 'quote'
"54", // E, the 55th letter in 'quote'
"22" // N, the 23rd letter in 'quote'
]
},
{
"clue": "Back at sea", // Labelled as clue 'B.' in the app
"answer": [
"24", // A, the 25th letter in 'quote'
"90", // F, the 91st letter in 'quote'
"47" // T, the 48th letter in 'quote'
]
},
{...more clues}
]
}
Required object elements:
-
title
A title for this puzzle.
-
constructor
The name of the puzzle maker.
-
publishDate
A date for this puzzle.
-
friendlyauthor
andfriendlyquote
These are displayed to the end-user on completion of a puzzle.
-
quote
This is the acrostic quote: uppercase alphabetic characters (A-Z) only, no punctuation, no double-spaces, no leading/trailing spaces.
-
clues
An array of clues/answers, in order starting with the clue/answer that will be automatically labelled 'A' by the app. This array must not exceed 26 members. Each item in
clues
contains the following:-
clue
The clue for this word.
-
answer
An array of numeric indices for each letter in this answer. These indices are NOT the numbers that appear in the end-user interface (the numbering/lettering displayed in the puzzle app is generated automatically).
Each index number corresponds to a character position in
quote
(where the first character ofquote
is at position0
). See comments in object example for illustration of usage.Note that each alphabetic character in
quote
should correspond to one (and only one) entry across allanswer
values for all of the puzzle'sclues
.
-
License
mfAcrostic is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Support
Support requests - including bug reports, usage/installation question, and feature requests - should be sent to the contact information found at the bottom of this page.
Donate
Support mfAcrostic with a donation to the developer - any amount is appreciated!