add chess puzzle book christmas hack - www.codemadness.org - www.codemadness.org saait content files
 (HTM) git clone git://git.codemadness.org/www.codemadness.org
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 6e80eb2b5cde18de263a210da5bf509757de1f83
 (DIR) parent bd956d932c2ade089983a740b33a3b1176959139
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Fri,  2 Feb 2024 13:48:56 +0100
       
       add chess puzzle book christmas hack
       
       Diffstat:
         M config.cfg                          |       2 +-
         M output/atom.xml                     |      14 +++++++++++++-
         M output/atom_content.xml             |     131 ++++++++++++++++++++++++++++++-
         A output/chess-puzzles.html           |     168 +++++++++++++++++++++++++++++++
         A output/chess-puzzles.md             |     151 +++++++++++++++++++++++++++++++
         M output/index                        |       1 +
         M output/index.html                   |       1 +
         A output/phlog/chess-puzzles          |     159 +++++++++++++++++++++++++++++++
         M output/rss.xml                      |       8 ++++++++
         M output/rss_content.xml              |     124 +++++++++++++++++++++++++++++++
         M output/sitemap.xml                  |       4 ++++
         M output/twtxt.txt                    |       1 +
         M output/urllist.txt                  |       1 +
         M output/xargs.md                     |       1 -
         A pages/chess-puzzles.cfg             |       6 ++++++
         A pages/chess-puzzles.md              |     151 +++++++++++++++++++++++++++++++
       
       16 files changed, 919 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/config.cfg b/config.cfg
       @@ -1,5 +1,5 @@
        # last updated the site.
       -siteupdated = 2023-12-17
       +siteupdated = 2024-02-02
        
        sitetitle = Codemadness
        siteurl = https://www.codemadness.org
 (DIR) diff --git a/output/atom.xml b/output/atom.xml
       @@ -2,11 +2,23 @@
        <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
                <title>Codemadness</title>
                <subtitle>blog with various projects and articles about computer-related things</subtitle>
       -        <updated>2023-12-17T00:00:00Z</updated>
       +        <updated>2024-02-02T00:00:00Z</updated>
                <link rel="alternate" type="text/html" href="https://www.codemadness.org" />
                <id>https://www.codemadness.org/atom.xml</id>
                <link rel="self" type="application/atom+xml" href="https://www.codemadness.org/atom.xml" />
        <entry>
       +        <title>Chess puzzle book generator</title>
       +        <link rel="alternate" type="text/html" href="https://www.codemadness.org/chess-puzzles.html" />
       +        <id>https://www.codemadness.org/chess-puzzles.html</id>
       +        <updated>2024-02-02T00:00:00Z</updated>
       +        <published>2024-02-02T00:00:00Z</published>
       +        <author>
       +                <name>Hiltjo</name>
       +                <uri>https://www.codemadness.org</uri>
       +        </author>
       +        <summary>Chess puzzle book generator</summary>
       +</entry>
       +<entry>
                <title>xargs: an example for parallel batch jobs</title>
                <link rel="alternate" type="text/html" href="https://www.codemadness.org/xargs.html" />
                <id>https://www.codemadness.org/xargs.html</id>
 (DIR) diff --git a/output/atom_content.xml b/output/atom_content.xml
       @@ -2,11 +2,140 @@
        <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
                <title>Codemadness</title>
                <subtitle>blog with various projects and articles about computer-related things</subtitle>
       -        <updated>2023-12-17T00:00:00Z</updated>
       +        <updated>2024-02-02T00:00:00Z</updated>
                <link rel="alternate" type="text/html" href="https://www.codemadness.org" />
                <id>https://www.codemadness.org/atom_content.xml</id>
                <link rel="self" type="application/atom+xml" href="https://www.codemadness.org/atom_content.xml" />
        <entry>
       +        <title>Chess puzzle book generator</title>
       +        <link rel="alternate" type="text/html" href="https://www.codemadness.org/chess-puzzles.html" />
       +        <id>https://www.codemadness.org/chess-puzzles.html</id>
       +        <updated>2024-02-02T00:00:00Z</updated>
       +        <published>2024-02-02T00:00:00Z</published>
       +        <author>
       +                <name>Hiltjo</name>
       +                <uri>https://www.codemadness.org</uri>
       +        </author>
       +        <summary>Chess puzzle book generator</summary>
       +        <content type="html"><![CDATA[<h1>Chess puzzle book generator</h1>
       +        <p><strong>Last modification on </strong> <time>2024-02-02</time></p>
       +        <p>This was a christmas hack for fun and non-profit.
       +I wanted to write a chess puzzle book generator.
       +Inspired by 1001 Deadly Checkmates by John Nunn, ISBN-13: 978-1906454258 and
       +similar puzzle books.</p>
       +<h1>Example output</h1>
       +<ul>
       +<li>English version: <a href="https://codemadness.org/downloads/puzzles/">https://codemadness.org/downloads/puzzles/</a></li>
       +<li>Dutch version: <a href="https://hiltjo.nl/puzzles/">https://hiltjo.nl/puzzles/</a></li>
       +</ul>
       +<p>Terminal version:</p>
       +<pre><code>curl -s 'https://codemadness.org/downloads/puzzles/index.vt' | less -R
       +</code></pre>
       +<p>I may or may not periodially update this page :)</p>
       +<p>Time flies (since Christmas), here is a valentine edition with attraction
       +puzzles (not only checkmates) using the red "love" theme.
       +It is optimized for his and her pleasure:</p>
       +<p><a href="https://codemadness.org/downloads/puzzles-valentine/">https://codemadness.org/downloads/puzzles-valentine/</a></p>
       +<h1>Quick overview of how it works</h1>
       +<p>The generate.sh shellscript generates the output and files for the puzzles.</p>
       +<p>The puzzles used are from the lichess.org puzzle database:
       +<a href="https://database.lichess.org/#puzzles">https://database.lichess.org/#puzzles</a></p>
       +<p>This database is a big CSV file containing the initial board state in the
       +Forsyth-Edwards Notation (FEN) format and the moves in Universal Chess
       +Interface (UCI) format. Each line contains the board state and the initial and
       +solution moves.</p>
       +<p>The generated index page is a HTML page, it lists the puzzles.  Each puzzle on
       +this page is an SVG image. This scalable image format looks good in all
       +resolutions.</p>
       +<h1>Open puzzle data</h1>
       +<p>Lichess is an <a href="https://lichess.org/source">open-source</a> and gratis website to play on-line chess. There are
       +no paid levels to unlock features.  All the software hosting Lichess is
       +open-source and anyone can register and play chess on it for free. Most of the
       +data about the games played is also open.</p>
       +<p>However, the website depends on your donations or contributions. If you can,
       +<a href="https://lichess.org/about">please do so</a>.</p>
       +<h1>generate.sh</h1>
       +<p>Read puzzles from the database and shuffle them. Do some sorting based on
       +difficulty and assign score points.</p>
       +<p>The random shuffling is done using a hard-coded seed. This means on the same
       +machine with the same puzzle database it will regenerate the same sequence of
       +random puzzles in a deterministic manner.</p>
       +<p>It outputs HTML, with support for dark mode. It also outputs .vt files suitable
       +directly for the terminal and includes a plain-text listing of the solutions
       +for the puzzles.</p>
       +<h1>fen.c</h1>
       +<p>Read and parse the board state in FEN format and read the UCI moves. It can
       +output to various formats.</p>
       +<p>See the man page for detailed usage information.</p>
       +<p>fen.c supports the following output formats:</p>
       +<ul>
       +<li>ascii - very simple ASCII mode.</li>
       +<li><a href="https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation">fen</a> - output FEN of the board state (from FEN and optional played moves).</li>
       +<li><a href="https://en.wikipedia.org/wiki/Portable_Game_Notation">pgn</a> - Portable Game Notation.</li>
       +<li>speak - mode to output a description of the moves in words.</li>
       +<li><a href="https://en.wikipedia.org/wiki/SVG">SVG</a> - Scalable Vector Graphics image.</li>
       +<li>tty - Terminal output with some markup using escape codes.</li>
       +</ul>
       +<p>fen.c can also run in CGI mode. This can be used on a HTTP server:</p>
       +<ul>
       +<li><a href="https://codemadness.org/onlyfens">https://codemadness.org/onlyfens</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;flip=1&amp;theme=green&amp;output=svg">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;flip=1&amp;theme=green&amp;output=svg</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=pgn">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=pgn</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=speak">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=speak</a></li>
       +</ul>
       +<p>Terminal output:</p>
       +<pre><code>curl -s 'https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=tty'
       +</code></pre>
       +<h2>Support for Dutch notated PGN and output</h2>
       +<p>For pgn and "speak mode" it has an option to output Dutch notated PGN or speech
       +too.</p>
       +<p>For example:</p>
       +<ul>
       +<li>Queen = Dame (Q -&gt; D), translated: lady.</li>
       +<li>Rook = Toren (R -&gt; T), translated: tower.</li>
       +<li>Bishop = Loper (B -&gt; L), translated: walker.</li>
       +<li>Knight = Paard (N -&gt; P), translated: horse.</li>
       +</ul>
       +<h2>Example script to stream games from Lichess</h2>
       +<p>There is an included example script that can stream Lichess games to the
       +terminal. It uses the Lichess API.  It will display the board using terminal
       +escape codes. The games are automatically annotated with PGN notation and with
       +text how a human would say the notation. This can also be piped to a speech
       +synthesizer like <a href="https://github.com/espeak-ng/espeak-ng/">espeak</a> as audio.</p>
       +<p>pgn-extract is a useful tool to convert Portable Game Notation (PGN) to
       +Universal Chess Interface (UCI) moves (or do many other useful chess related
       +things!).</p>
       +<h2>Example script to generate an animated gif from PGN.</h2>
       +<p>Theres also an example script included that can generate an animated gif from
       +PGN using <a href="https://ffmpeg.org/">ffmpeg</a>.</p>
       +<p>It creates an optimal color palette from the input images and generates an
       +optimized animated gif. The last move (typically some checkmate) is displayed
       +slightly longer.</p>
       +<h1>References and chess related links</h1>
       +<ul>
       +<li><p>Lichess FEN puzzle database:<br />  
       +<a href="https://database.lichess.org/#puzzles">https://database.lichess.org/#puzzles</a></p>
       +</li>
       +<li><p>lichess.org:<br />  
       +<a href="https://lichess.org/">https://lichess.org/</a></p>
       +</li>
       +<li><p>SVG of the individual pieces used for fen.c:<br />  
       +<a href="https://github.com/lichess-org/lila/tree/master/public/piece/cburnett">https://github.com/lichess-org/lila/tree/master/public/piece/cburnett</a></p>
       +</li>
       +<li><p>pgn-extract:<br />  
       +A great multi-purpose PGN manipulation program with many options:<br />  
       +<a href="https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/">https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/</a></p>
       +<p>An example to convert PGN games to UCI moves:<br />  
       +<code>pgn-extract --notags -Wuc</code></p>
       +</li>
       +<li><p>Stockfish:<br />  
       +Strong open source chess engine and analysis tool:<br />  
       +<a href="https://stockfishchess.org/">https://stockfishchess.org/</a></p>
       +</li>
       +</ul>
       +]]></content>
       +</entry>
       +<entry>
                <title>xargs: an example for parallel batch jobs</title>
                <link rel="alternate" type="text/html" href="https://www.codemadness.org/xargs.html" />
                <id>https://www.codemadness.org/xargs.html</id>
 (DIR) diff --git a/output/chess-puzzles.html b/output/chess-puzzles.html
       @@ -0,0 +1,168 @@
       +<!DOCTYPE html>
       +<html dir="ltr" lang="en">
       +<head>
       +        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       +        <meta http-equiv="Content-Language" content="en" />
       +        <meta name="viewport" content="width=device-width" />
       +        <meta name="keywords" content="chess, puzzles, lichess" />
       +        <meta name="description" content="Chess puzzle book generator" />
       +        <meta name="author" content="Hiltjo" />
       +        <meta name="generator" content="Static content generated using saait: https://codemadness.org/saait.html" />
       +        <title>Chess puzzle book generator - Codemadness</title>
       +        <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
       +        <link rel="stylesheet" href="print.css" type="text/css" media="print" />
       +        <link rel="alternate" href="atom.xml" type="application/atom+xml" title="Codemadness Atom Feed" />
       +        <link rel="alternate" href="atom_content.xml" type="application/atom+xml" title="Codemadness Atom Feed with content" />
       +        <link rel="icon" href="/favicon.png" type="image/png" />
       +</head>
       +<body>
       +        <nav id="menuwrap">
       +                <table id="menu" width="100%" border="0">
       +                <tr>
       +                        <td id="links" align="left">
       +                                <a href="index.html">Blog</a> |
       +                                <a href="/git/" title="Git repository with some of my projects">Git</a> |
       +                                <a href="/releases/">Releases</a> |
       +                                <a href="gopher://codemadness.org">Gopherhole</a>
       +                        </td>
       +                        <td id="links-contact" align="right">
       +                                <span class="hidden"> | </span>
       +                                <a href="/donate/">Donate</a> |
       +                                <a href="feeds.html">Feeds</a> |
       +                                <a href="pgp.asc">PGP</a> |
       +                                <a href="mailto:hiltjo@AT@codemadness.DOT.org">Mail</a>
       +                        </td>
       +                </tr>
       +                </table>
       +        </nav>
       +        <hr class="hidden" />
       +        <main id="mainwrap">
       +                <div id="main">
       +                        <article>
       +<header>
       +        <h1>Chess puzzle book generator</h1>
       +        <p>
       +        <strong>Last modification on </strong> <time>2024-02-02</time>
       +        </p>
       +</header>
       +
       +<p>This was a christmas hack for fun and non-profit.
       +I wanted to write a chess puzzle book generator.
       +Inspired by 1001 Deadly Checkmates by John Nunn, ISBN-13: 978-1906454258 and
       +similar puzzle books.</p>
       +<h1>Example output</h1>
       +<ul>
       +<li>English version: <a href="https://codemadness.org/downloads/puzzles/">https://codemadness.org/downloads/puzzles/</a></li>
       +<li>Dutch version: <a href="https://hiltjo.nl/puzzles/">https://hiltjo.nl/puzzles/</a></li>
       +</ul>
       +<p>Terminal version:</p>
       +<pre><code>curl -s 'https://codemadness.org/downloads/puzzles/index.vt' | less -R
       +</code></pre>
       +<p>I may or may not periodially update this page :)</p>
       +<p>Time flies (since Christmas), here is a valentine edition with attraction
       +puzzles (not only checkmates) using the red "love" theme.
       +It is optimized for his and her pleasure:</p>
       +<p><a href="https://codemadness.org/downloads/puzzles-valentine/">https://codemadness.org/downloads/puzzles-valentine/</a></p>
       +<h1>Quick overview of how it works</h1>
       +<p>The generate.sh shellscript generates the output and files for the puzzles.</p>
       +<p>The puzzles used are from the lichess.org puzzle database:
       +<a href="https://database.lichess.org/#puzzles">https://database.lichess.org/#puzzles</a></p>
       +<p>This database is a big CSV file containing the initial board state in the
       +Forsyth-Edwards Notation (FEN) format and the moves in Universal Chess
       +Interface (UCI) format. Each line contains the board state and the initial and
       +solution moves.</p>
       +<p>The generated index page is a HTML page, it lists the puzzles.  Each puzzle on
       +this page is an SVG image. This scalable image format looks good in all
       +resolutions.</p>
       +<h1>Open puzzle data</h1>
       +<p>Lichess is an <a href="https://lichess.org/source">open-source</a> and gratis website to play on-line chess. There are
       +no paid levels to unlock features.  All the software hosting Lichess is
       +open-source and anyone can register and play chess on it for free. Most of the
       +data about the games played is also open.</p>
       +<p>However, the website depends on your donations or contributions. If you can,
       +<a href="https://lichess.org/about">please do so</a>.</p>
       +<h1>generate.sh</h1>
       +<p>Read puzzles from the database and shuffle them. Do some sorting based on
       +difficulty and assign score points.</p>
       +<p>The random shuffling is done using a hard-coded seed. This means on the same
       +machine with the same puzzle database it will regenerate the same sequence of
       +random puzzles in a deterministic manner.</p>
       +<p>It outputs HTML, with support for dark mode. It also outputs .vt files suitable
       +directly for the terminal and includes a plain-text listing of the solutions
       +for the puzzles.</p>
       +<h1>fen.c</h1>
       +<p>Read and parse the board state in FEN format and read the UCI moves. It can
       +output to various formats.</p>
       +<p>See the man page for detailed usage information.</p>
       +<p>fen.c supports the following output formats:</p>
       +<ul>
       +<li>ascii - very simple ASCII mode.</li>
       +<li><a href="https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation">fen</a> - output FEN of the board state (from FEN and optional played moves).</li>
       +<li><a href="https://en.wikipedia.org/wiki/Portable_Game_Notation">pgn</a> - Portable Game Notation.</li>
       +<li>speak - mode to output a description of the moves in words.</li>
       +<li><a href="https://en.wikipedia.org/wiki/SVG">SVG</a> - Scalable Vector Graphics image.</li>
       +<li>tty - Terminal output with some markup using escape codes.</li>
       +</ul>
       +<p>fen.c can also run in CGI mode. This can be used on a HTTP server:</p>
       +<ul>
       +<li><a href="https://codemadness.org/onlyfens">https://codemadness.org/onlyfens</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;flip=1&amp;theme=green&amp;output=svg">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;flip=1&amp;theme=green&amp;output=svg</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=pgn">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=pgn</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=speak">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=speak</a></li>
       +</ul>
       +<p>Terminal output:</p>
       +<pre><code>curl -s 'https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=tty'
       +</code></pre>
       +<h2>Support for Dutch notated PGN and output</h2>
       +<p>For pgn and "speak mode" it has an option to output Dutch notated PGN or speech
       +too.</p>
       +<p>For example:</p>
       +<ul>
       +<li>Queen = Dame (Q -&gt; D), translated: lady.</li>
       +<li>Rook = Toren (R -&gt; T), translated: tower.</li>
       +<li>Bishop = Loper (B -&gt; L), translated: walker.</li>
       +<li>Knight = Paard (N -&gt; P), translated: horse.</li>
       +</ul>
       +<h2>Example script to stream games from Lichess</h2>
       +<p>There is an included example script that can stream Lichess games to the
       +terminal. It uses the Lichess API.  It will display the board using terminal
       +escape codes. The games are automatically annotated with PGN notation and with
       +text how a human would say the notation. This can also be piped to a speech
       +synthesizer like <a href="https://github.com/espeak-ng/espeak-ng/">espeak</a> as audio.</p>
       +<p>pgn-extract is a useful tool to convert Portable Game Notation (PGN) to
       +Universal Chess Interface (UCI) moves (or do many other useful chess related
       +things!).</p>
       +<h2>Example script to generate an animated gif from PGN.</h2>
       +<p>Theres also an example script included that can generate an animated gif from
       +PGN using <a href="https://ffmpeg.org/">ffmpeg</a>.</p>
       +<p>It creates an optimal color palette from the input images and generates an
       +optimized animated gif. The last move (typically some checkmate) is displayed
       +slightly longer.</p>
       +<h1>References and chess related links</h1>
       +<ul>
       +<li><p>Lichess FEN puzzle database:<br />  
       +<a href="https://database.lichess.org/#puzzles">https://database.lichess.org/#puzzles</a></p>
       +</li>
       +<li><p>lichess.org:<br />  
       +<a href="https://lichess.org/">https://lichess.org/</a></p>
       +</li>
       +<li><p>SVG of the individual pieces used for fen.c:<br />  
       +<a href="https://github.com/lichess-org/lila/tree/master/public/piece/cburnett">https://github.com/lichess-org/lila/tree/master/public/piece/cburnett</a></p>
       +</li>
       +<li><p>pgn-extract:<br />  
       +A great multi-purpose PGN manipulation program with many options:<br />  
       +<a href="https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/">https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/</a></p>
       +<p>An example to convert PGN games to UCI moves:<br />  
       +<code>pgn-extract --notags -Wuc</code></p>
       +</li>
       +<li><p>Stockfish:<br />  
       +Strong open source chess engine and analysis tool:<br />  
       +<a href="https://stockfishchess.org/">https://stockfishchess.org/</a></p>
       +</li>
       +</ul>
       +
       +                        </article>
       +                </div>
       +        </main>
       +</body>
       +</html>
 (DIR) diff --git a/output/chess-puzzles.md b/output/chess-puzzles.md
       @@ -0,0 +1,151 @@
       +This was a christmas hack for fun and non-profit.
       +I wanted to write a chess puzzle book generator.
       +Inspired by 1001 Deadly Checkmates by John Nunn, ISBN-13: 978-1906454258 and
       +similar puzzle books.
       +
       +
       +# Example output
       +
       +* English version: <https://codemadness.org/downloads/puzzles/>
       +* Dutch version: <https://hiltjo.nl/puzzles/>
       +
       +Terminal version:
       +
       +        curl -s 'https://codemadness.org/downloads/puzzles/index.vt' | less -R
       +
       +I may or may not periodially update this page :)
       +
       +Time flies (since Christmas), here is a valentine edition with attraction
       +puzzles (not only checkmates) using the red "love" theme.
       +It is optimized for his and her pleasure:
       +
       +<https://codemadness.org/downloads/puzzles-valentine/>
       +
       +
       +# Quick overview of how it works
       +
       +The generate.sh shellscript generates the output and files for the puzzles.
       +
       +The puzzles used are from the lichess.org puzzle database:
       +<https://database.lichess.org/#puzzles>
       +
       +This database is a big CSV file containing the initial board state in the
       +Forsyth-Edwards Notation (FEN) format and the moves in Universal Chess
       +Interface (UCI) format. Each line contains the board state and the initial and
       +solution moves.
       +
       +The generated index page is a HTML page, it lists the puzzles.  Each puzzle on
       +this page is an SVG image. This scalable image format looks good in all
       +resolutions.
       +
       +
       +# Open puzzle data
       +
       +Lichess is an [open-source](https://lichess.org/source) and gratis website to play on-line chess. There are
       +no paid levels to unlock features.  All the software hosting Lichess is
       +open-source and anyone can register and play chess on it for free. Most of the
       +data about the games played is also open.
       +
       +However, the website depends on your donations or contributions. If you can,
       +[please do so](https://lichess.org/about).
       +
       +
       +# generate.sh
       +
       +Read puzzles from the database and shuffle them. Do some sorting based on
       +difficulty and assign score points.
       +
       +The random shuffling is done using a hard-coded seed. This means on the same
       +machine with the same puzzle database it will regenerate the same sequence of
       +random puzzles in a deterministic manner.
       +
       +It outputs HTML, with support for dark mode. It also outputs .vt files suitable
       +directly for the terminal and includes a plain-text listing of the solutions
       +for the puzzles.
       +
       +
       +# fen.c
       +
       +Read and parse the board state in FEN format and read the UCI moves. It can
       +output to various formats.
       +
       +See the man page for detailed usage information.
       +
       +fen.c supports the following output formats:
       +
       +* ascii - very simple ASCII mode.
       +* [fen](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) - output FEN of the board state (from FEN and optional played moves).
       +* [pgn](https://en.wikipedia.org/wiki/Portable_Game_Notation) - Portable Game Notation.
       +* speak - mode to output a description of the moves in words.
       +* [SVG](https://en.wikipedia.org/wiki/SVG) - Scalable Vector Graphics image.
       +* tty - Terminal output with some markup using escape codes.
       +
       +fen.c can also run in CGI mode. This can be used on a HTTP server:
       +
       +* <https://codemadness.org/onlyfens>
       +* <https://codemadness.org/onlyfens?moves=e2e4%20e7e5&flip=1&theme=green&output=svg>
       +* <https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=pgn>
       +* <https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=speak>
       +
       +Terminal output:
       +
       +        curl -s 'https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=tty'
       +
       +
       +## Support for Dutch notated PGN and output
       +
       +For pgn and "speak mode" it has an option to output Dutch notated PGN or speech
       +too.
       +
       +For example:
       +
       +* Queen = Dame (Q -> D), translated: lady.
       +* Rook = Toren (R -> T), translated: tower.
       +* Bishop = Loper (B -> L), translated: walker.
       +* Knight = Paard (N -> P), translated: horse.
       +
       +
       +## Example script to stream games from Lichess
       +
       +There is an included example script that can stream Lichess games to the
       +terminal. It uses the Lichess API.  It will display the board using terminal
       +escape codes. The games are automatically annotated with PGN notation and with
       +text how a human would say the notation. This can also be piped to a speech
       +synthesizer like [espeak](https://github.com/espeak-ng/espeak-ng/) as audio.
       +
       +pgn-extract is a useful tool to convert Portable Game Notation (PGN) to
       +Universal Chess Interface (UCI) moves (or do many other useful chess related
       +things!).
       +
       +
       +## Example script to generate an animated gif from PGN.
       +
       +Theres also an example script included that can generate an animated gif from
       +PGN using [ffmpeg](https://ffmpeg.org/).
       +
       +It creates an optimal color palette from the input images and generates an
       +optimized animated gif. The last move (typically some checkmate) is displayed
       +slightly longer.
       +
       +
       +# References and chess related links
       +
       +* Lichess FEN puzzle database:  
       +  <https://database.lichess.org/#puzzles>
       +
       +* lichess.org:  
       +  <https://lichess.org/>
       +
       +* SVG of the individual pieces used for fen.c:  
       +  <https://github.com/lichess-org/lila/tree/master/public/piece/cburnett>
       +
       +* pgn-extract:  
       +  A great multi-purpose PGN manipulation program with many options:  
       +  <https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/>
       +  
       +  An example to convert PGN games to UCI moves:  
       +  `pgn-extract --notags -Wuc`
       +
       +* Stockfish:  
       +  Strong open source chess engine and analysis tool:  
       +  <https://stockfishchess.org/>
 (DIR) diff --git a/output/index b/output/index
       @@ -11,6 +11,7 @@ i                codemadness.org        70
        i                codemadness.org        70
        iPhlog posts                codemadness.org        70
        i                codemadness.org        70
       +12024-02-02 Chess puzzle book generator        /phlog/chess-puzzles        codemadness.org        70
        12023-11-22 xargs: an example for parallel batch jobs        /phlog/xargs        codemadness.org        70
        12023-11-20 Improved Youtube RSS/Atom feed        /phlog/youtube-feed        codemadness.org        70
        12023-10-25 Setup your own mail paste service        /phlog/mailservice        codemadness.org        70
 (DIR) diff --git a/output/index.html b/output/index.html
       @@ -40,6 +40,7 @@
                        <div id="main">
                                <h1>Posts</h1>
                                <table>
       +<tr><td><time>2024-02-02</time></td><td><a href="chess-puzzles.html">Chess puzzle book generator</a></td></tr>
        <tr><td><time>2023-11-22</time></td><td><a href="xargs.html">xargs: an example for parallel batch jobs</a></td></tr>
        <tr><td><time>2023-11-20</time></td><td><a href="youtube-feed.html">Improved Youtube RSS/Atom feed</a></td></tr>
        <tr><td><time>2023-10-25</time></td><td><a href="mailservice.html">Setup your own mail paste service</a></td></tr>
 (DIR) diff --git a/output/phlog/chess-puzzles b/output/phlog/chess-puzzles
       @@ -0,0 +1,159 @@
       +1<- Back        /        codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# Chess puzzle book generator                codemadness.org        70
       +i                codemadness.org        70
       +iLast modification on 2024-02-02                codemadness.org        70
       +i                codemadness.org        70
       +iThis was a christmas hack for fun and non-profit.                codemadness.org        70
       +iI wanted to write a chess puzzle book generator.                codemadness.org        70
       +iInspired by 1001 Deadly Checkmates by John Nunn, ISBN-13: 978-1906454258 and                codemadness.org        70
       +isimilar puzzle books.                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# Example output                codemadness.org        70
       +i                codemadness.org        70
       +h* English version: »https://codemadness.org/downloads/puzzles/«        URL:https://codemadness.org/downloads/puzzles/        codemadness.org        70
       +h* Dutch version: »https://hiltjo.nl/puzzles/«        URL:https://hiltjo.nl/puzzles/        codemadness.org        70
       +i                codemadness.org        70
       +iTerminal version:                codemadness.org        70
       +i                codemadness.org        70
       +i        curl -s 'https://codemadness.org/downloads/puzzles/index.vt' | less -R                codemadness.org        70
       +i                codemadness.org        70
       +iI may or may not periodially update this page :)                codemadness.org        70
       +i                codemadness.org        70
       +iTime flies (since Christmas), here is a valentine edition with attraction                codemadness.org        70
       +ipuzzles (not only checkmates) using the red "love" theme.                codemadness.org        70
       +iIt is optimized for his and her pleasure:                codemadness.org        70
       +i                codemadness.org        70
       +hhttps://codemadness.org/downloads/puzzles-valentine/        URL:https://codemadness.org/downloads/puzzles-valentine/        codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# Quick overview of how it works                codemadness.org        70
       +i                codemadness.org        70
       +iThe generate.sh shellscript generates the output and files for the puzzles.                codemadness.org        70
       +i                codemadness.org        70
       +iThe puzzles used are from the lichess.org puzzle database:                codemadness.org        70
       +hhttps://database.lichess.org/#puzzles        URL:https://database.lichess.org/#puzzles        codemadness.org        70
       +i                codemadness.org        70
       +iThis database is a big CSV file containing the initial board state in the                codemadness.org        70
       +iForsyth-Edwards Notation (FEN) format and the moves in Universal Chess                codemadness.org        70
       +iInterface (UCI) format. Each line contains the board state and the initial and                codemadness.org        70
       +isolution moves.                codemadness.org        70
       +i                codemadness.org        70
       +iThe generated index page is a HTML page, it lists the puzzles.  Each puzzle on                codemadness.org        70
       +ithis page is an SVG image. This scalable image format looks good in all                codemadness.org        70
       +iresolutions.                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# Open puzzle data                codemadness.org        70
       +i                codemadness.org        70
       +hLichess is an »open-source« and gratis website to play on-line chess. There are        URL:https://lichess.org/source        codemadness.org        70
       +ino paid levels to unlock features.  All the software hosting Lichess is                codemadness.org        70
       +iopen-source and anyone can register and play chess on it for free. Most of the                codemadness.org        70
       +idata about the games played is also open.                codemadness.org        70
       +i                codemadness.org        70
       +iHowever, the website depends on your donations or contributions. If you can,                codemadness.org        70
       +hplease do so.        URL:https://lichess.org/about        codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# generate.sh                codemadness.org        70
       +i                codemadness.org        70
       +iRead puzzles from the database and shuffle them. Do some sorting based on                codemadness.org        70
       +idifficulty and assign score points.                codemadness.org        70
       +i                codemadness.org        70
       +iThe random shuffling is done using a hard-coded seed. This means on the same                codemadness.org        70
       +imachine with the same puzzle database it will regenerate the same sequence of                codemadness.org        70
       +irandom puzzles in a deterministic manner.                codemadness.org        70
       +i                codemadness.org        70
       +iIt outputs HTML, with support for dark mode. It also outputs .vt files suitable                codemadness.org        70
       +idirectly for the terminal and includes a plain-text listing of the solutions                codemadness.org        70
       +ifor the puzzles.                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# fen.c                codemadness.org        70
       +i                codemadness.org        70
       +iRead and parse the board state in FEN format and read the UCI moves. It can                codemadness.org        70
       +ioutput to various formats.                codemadness.org        70
       +i                codemadness.org        70
       +iSee the man page for detailed usage information.                codemadness.org        70
       +i                codemadness.org        70
       +ifen.c supports the following output formats:                codemadness.org        70
       +i                codemadness.org        70
       +i* ascii - very simple ASCII mode.                codemadness.org        70
       +h* »fen« - output FEN of the board state (from FEN and optional played moves).        URL:https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation        codemadness.org        70
       +h* »pgn« - Portable Game Notation.        URL:https://en.wikipedia.org/wiki/Portable_Game_Notation        codemadness.org        70
       +i* speak - mode to output a description of the moves in words.                codemadness.org        70
       +h* »SVG« - Scalable Vector Graphics image.        URL:https://en.wikipedia.org/wiki/SVG        codemadness.org        70
       +i* tty - Terminal output with some markup using escape codes.                codemadness.org        70
       +i                codemadness.org        70
       +ifen.c can also run in CGI mode. This can be used on a HTTP server:                codemadness.org        70
       +i                codemadness.org        70
       +h* https://codemadness.org/onlyfens        URL:https://codemadness.org/onlyfens        codemadness.org        70
       +h* https://codemadness.org/onlyfens?moves=e2e4%20e7e5&flip=1&theme=green&output=svg        URL:https://codemadness.org/onlyfens?moves=e2e4%20e7e5&flip=1&theme=green&output=svg        codemadness.org        70
       +h* https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=pgn        URL:https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=pgn        codemadness.org        70
       +h* https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=speak        URL:https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=speak        codemadness.org        70
       +i                codemadness.org        70
       +iTerminal output:                codemadness.org        70
       +i                codemadness.org        70
       +i        curl -s 'https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=tty'                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i## Support for Dutch notated PGN and output                codemadness.org        70
       +i                codemadness.org        70
       +iFor pgn and "speak mode" it has an option to output Dutch notated PGN or speech                codemadness.org        70
       +itoo.                codemadness.org        70
       +i                codemadness.org        70
       +iFor example:                codemadness.org        70
       +i                codemadness.org        70
       +i* Queen = Dame (Q -> D), translated: lady.                codemadness.org        70
       +i* Rook = Toren (R -> T), translated: tower.                codemadness.org        70
       +i* Bishop = Loper (B -> L), translated: walker.                codemadness.org        70
       +i* Knight = Paard (N -> P), translated: horse.                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i## Example script to stream games from Lichess                codemadness.org        70
       +i                codemadness.org        70
       +iThere is an included example script that can stream Lichess games to the                codemadness.org        70
       +iterminal. It uses the Lichess API.  It will display the board using terminal                codemadness.org        70
       +iescape codes. The games are automatically annotated with PGN notation and with                codemadness.org        70
       +itext how a human would say the notation. This can also be piped to a speech                codemadness.org        70
       +hsynthesizer like »espeak« as audio.        URL:https://github.com/espeak-ng/espeak-ng/        codemadness.org        70
       +i                codemadness.org        70
       +ipgn-extract is a useful tool to convert Portable Game Notation (PGN) to                codemadness.org        70
       +iUniversal Chess Interface (UCI) moves (or do many other useful chess related                codemadness.org        70
       +ithings!).                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i## Example script to generate an animated gif from PGN.                codemadness.org        70
       +i                codemadness.org        70
       +iTheres also an example script included that can generate an animated gif from                codemadness.org        70
       +hPGN using »ffmpeg«.        URL:https://ffmpeg.org/        codemadness.org        70
       +i                codemadness.org        70
       +iIt creates an optimal color palette from the input images and generates an                codemadness.org        70
       +ioptimized animated gif. The last move (typically some checkmate) is displayed                codemadness.org        70
       +islightly longer.                codemadness.org        70
       +i                codemadness.org        70
       +i                codemadness.org        70
       +i# References and chess related links                codemadness.org        70
       +i                codemadness.org        70
       +i* Lichess FEN puzzle database:                  codemadness.org        70
       +h  https://database.lichess.org/#puzzles        URL:https://database.lichess.org/#puzzles        codemadness.org        70
       +i                codemadness.org        70
       +i* lichess.org:                  codemadness.org        70
       +h  https://lichess.org/        URL:https://lichess.org/        codemadness.org        70
       +i                codemadness.org        70
       +i* SVG of the individual pieces used for fen.c:                  codemadness.org        70
       +h  https://github.com/lichess-org/lila/tree/master/public/piece/cburnett        URL:https://github.com/lichess-org/lila/tree/master/public/piece/cburnett        codemadness.org        70
       +i                codemadness.org        70
       +i* pgn-extract:                  codemadness.org        70
       +i  A great multi-purpose PGN manipulation program with many options:                  codemadness.org        70
       +h  https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/        URL:https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/        codemadness.org        70
       +i                  codemadness.org        70
       +i  An example to convert PGN games to UCI moves:                  codemadness.org        70
       +i  `pgn-extract --notags -Wuc`                codemadness.org        70
       +i                codemadness.org        70
       +i* Stockfish:                  codemadness.org        70
       +i  Strong open source chess engine and analysis tool:                  codemadness.org        70
       +h  https://stockfishchess.org/        URL:https://stockfishchess.org/        codemadness.org        70
       +.
 (DIR) diff --git a/output/rss.xml b/output/rss.xml
       @@ -7,6 +7,14 @@
                <description>blog with various projects and articles about computer-related things</description>
                <link>https://www.codemadness.org</link>
        <item>
       +        <title>Chess puzzle book generator</title>
       +        <link>https://www.codemadness.org/chess-puzzles.html</link>
       +        <guid>https://www.codemadness.org/chess-puzzles.html</guid>
       +        <dc:date>2024-02-02T00:00:00Z</dc:date>
       +        <author>Hiltjo</author>
       +        <description>Chess puzzle book generator</description>
       +</item>
       +<item>
                <title>xargs: an example for parallel batch jobs</title>
                <link>https://www.codemadness.org/xargs.html</link>
                <guid>https://www.codemadness.org/xargs.html</guid>
 (DIR) diff --git a/output/rss_content.xml b/output/rss_content.xml
       @@ -7,6 +7,130 @@
                <description>blog with various projects and articles about computer-related things</description>
                <link>https://www.codemadness.org</link>
        <item>
       +        <title>Chess puzzle book generator</title>
       +        <link>https://www.codemadness.org/chess-puzzles.html</link>
       +        <guid>https://www.codemadness.org/chess-puzzles.html</guid>
       +        <dc:date>2024-02-02T00:00:00Z</dc:date>
       +        <author>Hiltjo</author>
       +        <description><![CDATA[<h1>Chess puzzle book generator</h1>
       +        <p><strong>Last modification on </strong> <time>2024-02-02</time></p>
       +        <p>This was a christmas hack for fun and non-profit.
       +I wanted to write a chess puzzle book generator.
       +Inspired by 1001 Deadly Checkmates by John Nunn, ISBN-13: 978-1906454258 and
       +similar puzzle books.</p>
       +<h1>Example output</h1>
       +<ul>
       +<li>English version: <a href="https://codemadness.org/downloads/puzzles/">https://codemadness.org/downloads/puzzles/</a></li>
       +<li>Dutch version: <a href="https://hiltjo.nl/puzzles/">https://hiltjo.nl/puzzles/</a></li>
       +</ul>
       +<p>Terminal version:</p>
       +<pre><code>curl -s 'https://codemadness.org/downloads/puzzles/index.vt' | less -R
       +</code></pre>
       +<p>I may or may not periodially update this page :)</p>
       +<p>Time flies (since Christmas), here is a valentine edition with attraction
       +puzzles (not only checkmates) using the red "love" theme.
       +It is optimized for his and her pleasure:</p>
       +<p><a href="https://codemadness.org/downloads/puzzles-valentine/">https://codemadness.org/downloads/puzzles-valentine/</a></p>
       +<h1>Quick overview of how it works</h1>
       +<p>The generate.sh shellscript generates the output and files for the puzzles.</p>
       +<p>The puzzles used are from the lichess.org puzzle database:
       +<a href="https://database.lichess.org/#puzzles">https://database.lichess.org/#puzzles</a></p>
       +<p>This database is a big CSV file containing the initial board state in the
       +Forsyth-Edwards Notation (FEN) format and the moves in Universal Chess
       +Interface (UCI) format. Each line contains the board state and the initial and
       +solution moves.</p>
       +<p>The generated index page is a HTML page, it lists the puzzles.  Each puzzle on
       +this page is an SVG image. This scalable image format looks good in all
       +resolutions.</p>
       +<h1>Open puzzle data</h1>
       +<p>Lichess is an <a href="https://lichess.org/source">open-source</a> and gratis website to play on-line chess. There are
       +no paid levels to unlock features.  All the software hosting Lichess is
       +open-source and anyone can register and play chess on it for free. Most of the
       +data about the games played is also open.</p>
       +<p>However, the website depends on your donations or contributions. If you can,
       +<a href="https://lichess.org/about">please do so</a>.</p>
       +<h1>generate.sh</h1>
       +<p>Read puzzles from the database and shuffle them. Do some sorting based on
       +difficulty and assign score points.</p>
       +<p>The random shuffling is done using a hard-coded seed. This means on the same
       +machine with the same puzzle database it will regenerate the same sequence of
       +random puzzles in a deterministic manner.</p>
       +<p>It outputs HTML, with support for dark mode. It also outputs .vt files suitable
       +directly for the terminal and includes a plain-text listing of the solutions
       +for the puzzles.</p>
       +<h1>fen.c</h1>
       +<p>Read and parse the board state in FEN format and read the UCI moves. It can
       +output to various formats.</p>
       +<p>See the man page for detailed usage information.</p>
       +<p>fen.c supports the following output formats:</p>
       +<ul>
       +<li>ascii - very simple ASCII mode.</li>
       +<li><a href="https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation">fen</a> - output FEN of the board state (from FEN and optional played moves).</li>
       +<li><a href="https://en.wikipedia.org/wiki/Portable_Game_Notation">pgn</a> - Portable Game Notation.</li>
       +<li>speak - mode to output a description of the moves in words.</li>
       +<li><a href="https://en.wikipedia.org/wiki/SVG">SVG</a> - Scalable Vector Graphics image.</li>
       +<li>tty - Terminal output with some markup using escape codes.</li>
       +</ul>
       +<p>fen.c can also run in CGI mode. This can be used on a HTTP server:</p>
       +<ul>
       +<li><a href="https://codemadness.org/onlyfens">https://codemadness.org/onlyfens</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;flip=1&amp;theme=green&amp;output=svg">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;flip=1&amp;theme=green&amp;output=svg</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=pgn">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=pgn</a></li>
       +<li><a href="https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=speak">https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=speak</a></li>
       +</ul>
       +<p>Terminal output:</p>
       +<pre><code>curl -s 'https://codemadness.org/onlyfens?moves=e2e4%20e7e5&amp;output=tty'
       +</code></pre>
       +<h2>Support for Dutch notated PGN and output</h2>
       +<p>For pgn and "speak mode" it has an option to output Dutch notated PGN or speech
       +too.</p>
       +<p>For example:</p>
       +<ul>
       +<li>Queen = Dame (Q -&gt; D), translated: lady.</li>
       +<li>Rook = Toren (R -&gt; T), translated: tower.</li>
       +<li>Bishop = Loper (B -&gt; L), translated: walker.</li>
       +<li>Knight = Paard (N -&gt; P), translated: horse.</li>
       +</ul>
       +<h2>Example script to stream games from Lichess</h2>
       +<p>There is an included example script that can stream Lichess games to the
       +terminal. It uses the Lichess API.  It will display the board using terminal
       +escape codes. The games are automatically annotated with PGN notation and with
       +text how a human would say the notation. This can also be piped to a speech
       +synthesizer like <a href="https://github.com/espeak-ng/espeak-ng/">espeak</a> as audio.</p>
       +<p>pgn-extract is a useful tool to convert Portable Game Notation (PGN) to
       +Universal Chess Interface (UCI) moves (or do many other useful chess related
       +things!).</p>
       +<h2>Example script to generate an animated gif from PGN.</h2>
       +<p>Theres also an example script included that can generate an animated gif from
       +PGN using <a href="https://ffmpeg.org/">ffmpeg</a>.</p>
       +<p>It creates an optimal color palette from the input images and generates an
       +optimized animated gif. The last move (typically some checkmate) is displayed
       +slightly longer.</p>
       +<h1>References and chess related links</h1>
       +<ul>
       +<li><p>Lichess FEN puzzle database:<br />  
       +<a href="https://database.lichess.org/#puzzles">https://database.lichess.org/#puzzles</a></p>
       +</li>
       +<li><p>lichess.org:<br />  
       +<a href="https://lichess.org/">https://lichess.org/</a></p>
       +</li>
       +<li><p>SVG of the individual pieces used for fen.c:<br />  
       +<a href="https://github.com/lichess-org/lila/tree/master/public/piece/cburnett">https://github.com/lichess-org/lila/tree/master/public/piece/cburnett</a></p>
       +</li>
       +<li><p>pgn-extract:<br />  
       +A great multi-purpose PGN manipulation program with many options:<br />  
       +<a href="https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/">https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/</a></p>
       +<p>An example to convert PGN games to UCI moves:<br />  
       +<code>pgn-extract --notags -Wuc</code></p>
       +</li>
       +<li><p>Stockfish:<br />  
       +Strong open source chess engine and analysis tool:<br />  
       +<a href="https://stockfishchess.org/">https://stockfishchess.org/</a></p>
       +</li>
       +</ul>
       +]]></description>
       +</item>
       +<item>
                <title>xargs: an example for parallel batch jobs</title>
                <link>https://www.codemadness.org/xargs.html</link>
                <guid>https://www.codemadness.org/xargs.html</guid>
 (DIR) diff --git a/output/sitemap.xml b/output/sitemap.xml
       @@ -1,6 +1,10 @@
        <?xml version="1.0" encoding="UTF-8"?>
        <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
        <url>
       +        <loc>https://www.codemadness.org/chess-puzzles.html</loc>
       +        <lastmod>2024-02-02</lastmod>
       +</url>
       +<url>
                <loc>https://www.codemadness.org/xargs.html</loc>
                <lastmod>2023-12-17</lastmod>
        </url>
 (DIR) diff --git a/output/twtxt.txt b/output/twtxt.txt
       @@ -1,3 +1,4 @@
       +2024-02-02T00:00:00Z        Chess puzzle book generator: https://www.codemadness.org/chess-puzzles.html
        2023-11-22T00:00:00Z        xargs: an example for parallel batch jobs: https://www.codemadness.org/xargs.html
        2023-11-20T00:00:00Z        Improved Youtube RSS/Atom feed: https://www.codemadness.org/youtube-feed.html
        2023-10-25T00:00:00Z        Setup your own mail paste service: https://www.codemadness.org/mailservice.html
 (DIR) diff --git a/output/urllist.txt b/output/urllist.txt
       @@ -1,3 +1,4 @@
       +https://www.codemadness.org/chess-puzzles.html
        https://www.codemadness.org/xargs.html
        https://www.codemadness.org/youtube-feed.html
        https://www.codemadness.org/mailservice.html
 (DIR) diff --git a/output/xargs.md b/output/xargs.md
       @@ -154,7 +154,6 @@ The child process:
          xargs stops running also.
        
        
       -
        # Description of used xargs options
        
        From the OpenBSD man page: <https://man.openbsd.org/xargs>
 (DIR) diff --git a/pages/chess-puzzles.cfg b/pages/chess-puzzles.cfg
       @@ -0,0 +1,6 @@
       +title = Chess puzzle book generator
       +id = chess-puzzles
       +description = Chess puzzle book generator
       +keywords = chess, puzzles, lichess
       +created = 2024-02-02
       +updated = 2024-02-02
 (DIR) diff --git a/pages/chess-puzzles.md b/pages/chess-puzzles.md
       @@ -0,0 +1,151 @@
       +This was a christmas hack for fun and non-profit.
       +I wanted to write a chess puzzle book generator.
       +Inspired by 1001 Deadly Checkmates by John Nunn, ISBN-13: 978-1906454258 and
       +similar puzzle books.
       +
       +
       +# Example output
       +
       +* English version: <https://codemadness.org/downloads/puzzles/>
       +* Dutch version: <https://hiltjo.nl/puzzles/>
       +
       +Terminal version:
       +
       +        curl -s 'https://codemadness.org/downloads/puzzles/index.vt' | less -R
       +
       +I may or may not periodially update this page :)
       +
       +Time flies (since Christmas), here is a valentine edition with attraction
       +puzzles (not only checkmates) using the red "love" theme.
       +It is optimized for his and her pleasure:
       +
       +<https://codemadness.org/downloads/puzzles-valentine/>
       +
       +
       +# Quick overview of how it works
       +
       +The generate.sh shellscript generates the output and files for the puzzles.
       +
       +The puzzles used are from the lichess.org puzzle database:
       +<https://database.lichess.org/#puzzles>
       +
       +This database is a big CSV file containing the initial board state in the
       +Forsyth-Edwards Notation (FEN) format and the moves in Universal Chess
       +Interface (UCI) format. Each line contains the board state and the initial and
       +solution moves.
       +
       +The generated index page is a HTML page, it lists the puzzles.  Each puzzle on
       +this page is an SVG image. This scalable image format looks good in all
       +resolutions.
       +
       +
       +# Open puzzle data
       +
       +Lichess is an [open-source](https://lichess.org/source) and gratis website to play on-line chess. There are
       +no paid levels to unlock features.  All the software hosting Lichess is
       +open-source and anyone can register and play chess on it for free. Most of the
       +data about the games played is also open.
       +
       +However, the website depends on your donations or contributions. If you can,
       +[please do so](https://lichess.org/about).
       +
       +
       +# generate.sh
       +
       +Read puzzles from the database and shuffle them. Do some sorting based on
       +difficulty and assign score points.
       +
       +The random shuffling is done using a hard-coded seed. This means on the same
       +machine with the same puzzle database it will regenerate the same sequence of
       +random puzzles in a deterministic manner.
       +
       +It outputs HTML, with support for dark mode. It also outputs .vt files suitable
       +directly for the terminal and includes a plain-text listing of the solutions
       +for the puzzles.
       +
       +
       +# fen.c
       +
       +Read and parse the board state in FEN format and read the UCI moves. It can
       +output to various formats.
       +
       +See the man page for detailed usage information.
       +
       +fen.c supports the following output formats:
       +
       +* ascii - very simple ASCII mode.
       +* [fen](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) - output FEN of the board state (from FEN and optional played moves).
       +* [pgn](https://en.wikipedia.org/wiki/Portable_Game_Notation) - Portable Game Notation.
       +* speak - mode to output a description of the moves in words.
       +* [SVG](https://en.wikipedia.org/wiki/SVG) - Scalable Vector Graphics image.
       +* tty - Terminal output with some markup using escape codes.
       +
       +fen.c can also run in CGI mode. This can be used on a HTTP server:
       +
       +* <https://codemadness.org/onlyfens>
       +* <https://codemadness.org/onlyfens?moves=e2e4%20e7e5&flip=1&theme=green&output=svg>
       +* <https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=pgn>
       +* <https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=speak>
       +
       +Terminal output:
       +
       +        curl -s 'https://codemadness.org/onlyfens?moves=e2e4%20e7e5&output=tty'
       +
       +
       +## Support for Dutch notated PGN and output
       +
       +For pgn and "speak mode" it has an option to output Dutch notated PGN or speech
       +too.
       +
       +For example:
       +
       +* Queen = Dame (Q -> D), translated: lady.
       +* Rook = Toren (R -> T), translated: tower.
       +* Bishop = Loper (B -> L), translated: walker.
       +* Knight = Paard (N -> P), translated: horse.
       +
       +
       +## Example script to stream games from Lichess
       +
       +There is an included example script that can stream Lichess games to the
       +terminal. It uses the Lichess API.  It will display the board using terminal
       +escape codes. The games are automatically annotated with PGN notation and with
       +text how a human would say the notation. This can also be piped to a speech
       +synthesizer like [espeak](https://github.com/espeak-ng/espeak-ng/) as audio.
       +
       +pgn-extract is a useful tool to convert Portable Game Notation (PGN) to
       +Universal Chess Interface (UCI) moves (or do many other useful chess related
       +things!).
       +
       +
       +## Example script to generate an animated gif from PGN.
       +
       +Theres also an example script included that can generate an animated gif from
       +PGN using [ffmpeg](https://ffmpeg.org/).
       +
       +It creates an optimal color palette from the input images and generates an
       +optimized animated gif. The last move (typically some checkmate) is displayed
       +slightly longer.
       +
       +
       +# References and chess related links
       +
       +* Lichess FEN puzzle database:  
       +  <https://database.lichess.org/#puzzles>
       +
       +* lichess.org:  
       +  <https://lichess.org/>
       +
       +* SVG of the individual pieces used for fen.c:  
       +  <https://github.com/lichess-org/lila/tree/master/public/piece/cburnett>
       +
       +* pgn-extract:  
       +  A great multi-purpose PGN manipulation program with many options:  
       +  <https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/>
       +  
       +  An example to convert PGN games to UCI moves:  
       +  `pgn-extract --notags -Wuc`
       +
       +* Stockfish:  
       +  Strong open source chess engine and analysis tool:  
       +  <https://stockfishchess.org/>