1
0
Fork 0
mirror of https://github.com/dirtbags/moth.git synced 2025-01-08 21:11:06 -07:00
moth/example-puzzles/example/3/mkpuzzle
2020-09-11 13:03:19 -06:00

34 lines
757 B
Bash
Executable file

#! /bin/sh
number=$(seq 20 500 | shuf -n 1)
answer=$(echo $(grep -v "['A-Z]" /usr/share/dict/words | shuf -n 4))
case "$1:$2" in
:)
cat <<EOT
{
"Pre": {
"Authors": ["neale"],
"Body": "<p>Dynamic puzzles are provided with a JSON-generating <code>mkpuzzles</code> program in the puzzle directory.</p><img src='salad.jpg'>",
"Attachments": ["salad.jpg"]
},
"Answers": [
"$answer"
],
"Debug": {
"Summary": "Dynamic puzzles",
"Hints": [
"Check the debug output to get the answer."
],
"Errors": [],
"Log": [
"$number is a positive integer"
]
}
}
EOT
;;
-file:salad.jpg)
cat salad.jpg
;;
esac