source code of /projects/anonymine/index.html.src.sh

Last modified
Lines 424

Parent directory Download CGIread sitemap Main page

Quick links: about content dl-unix dl-windows download news platforms release-notes screenshots title top

  1. #!/bin/bash
  2. version=$1
  3. date=$2
  4. windows_version=$3
  5. windows_date=$4
  6. cat << __EOF__
  7. __HTML5__
  8.         <title>Anonymine - guess free minesweeper</title>
  9.         <meta name="description" content="Anonymine is a text based
  10. minesweeper that can be won without any guessing, and has a few other
  11. features, including hexagonal and von Neumann fields."/>
  12.         <style>
  13.             #screenshots p
  14.             {
  15.                 margin-bottom: 2em;
  16.             }
  17.             #platforms dt
  18.             {
  19.                 font-size: 105%;
  20.             }
  21.             #platforms dd
  22.             {
  23.                 font-size: 95%;
  24.                 margin-bottom: 0.167em;
  25.             }
  26.             .dl-
  27.             {
  28.                 padding-left: .5em;
  29.             }
  30.             .download
  31.             {
  32.                 vertical-align: middle;
  33.                 font-size: 110%;
  34.             }
  35.             .download::before
  36.             {
  37.                 vertical-align: middle;
  38.                 font-size: 250%;
  39.                 content: '⭳';
  40.                 padding-right: .25em;
  41.             }
  42.         </style>
  43.     </head>
  44.     <body>
  45.         __NAVIGATION__
  46.         <main><div id="content">
  47.             <h1 id="title">Anonymine - guess free minesweeper</h1>
  48.             <p class="notprint" style="max-width: 100%;">
  49.             <!-- If I make these images link back, it will cause
  50.             accessiblity issues on mobile devices. -->
  51.             <img src="imgs4/banner1.png" alt="" width="420" height="280"/>
  52.             <img src="imgs4/banner2.png" alt="" width="420" height="280"/>
  53.             </p>
  54.             <div id="top">
  55.                 <p>Latest version: ${version} released on ${date}
  56.                    - <a href="#news">what's new</a></p>
  57.                 <ul>
  58.                     <li><a href="#about">About</a></li>
  59.                     <li>
  60.                         <a href="#download">Download</a>
  61.                         <small>
  62.                             <span class="dl-">(<a href="#dl-unix">Linux &amp; Unix,</a></span>
  63.                             <a href="#dl-unix" class="dl-">macOS,</a>
  64.                             <a href="#dl-windows" class="dl-">Windows,</a>
  65.                             <a href="#dl-unix" class="dl-">Haiku OS</a>)
  66.                         </small>
  67.                     </li>
  68.                     <li><a href="#screenshots">Screenshots</a></li>
  69.                     <li><a href="#platforms">Platforms</a></li>
  70.                     <li><a href="#news">What's new?</a></li>
  71.                 </ul>
  72.                 <p>
  73.                     You can try it on my demo server using SSH.
  74.                     Log in as play@anonymine-demo.oskog97.com,
  75.                     password is "play".<br/>
  76.                     <a href="http://anonymine-demo.oskog97.com/" class="printurl"
  77.                     >Leaderboard for public demo server</a>
  78.                 </p>
  79.             </div>
  80.             <section><div class="section" id="about">
  81.             <h2>About</h2>
  82.             <p class="notprint"><small><a href="#top">To top of the page</a></small></p>
  83.             <p>
  84.                 Anonymine is the "anonymous minesweeper" as I never had any
  85.                 name for it, but I think "Anonymine" works just fine.
  86.                 Back in December 2015 I was curious about creating an algorithm
  87.                 for solving minesweeper, and then I needed an excuse for it
  88.                 so I turned it into a terminal game that can be solved wihout any
  89.                 guessing.
  90.             </p>
  91.             <p>
  92.                 Do note that it runs in the terminal, so it may not be your cup of
  93.                 tea.  Mouse input is usually supported, but only really useful in
  94.                 hexagonal mode.
  95.             </p>
  96.             <p>
  97.                 Being solvable without guessing is not its only feature,
  98.                 it has many other unusual or even unique features:
  99.                 the games are fully customizable and Anonymine seems to be the
  100.                 only minesweeper with <span class="a"><a
  101.                 href="https://en.wikipedia.org/wiki/Von_Neumann_neighborhood"
  102.                 >von Neumann grids</a>.</span>
  103.                 <!-- No printurl, it's just Wikipedia. -->
  104.             </p>
  105.             <p>
  106.                 For each game you can set the field type (normal / hexagonal
  107.                 / von Neumann), width, height and number of mines, only
  108.                 restricted to certain minimums and security limits (to avoid
  109.                 igniting your computer).
  110.             </p>
  111.             <div class="atom">
  112.             <h3>The supported field types/game types are:</h3>
  113.             <div class="atom">
  114.             <!-- FIXME: This should be a dl with dt and dd. -->
  115.             <h4>Von Neumann grids</h4>
  116.                 <p>
  117.                     I have never seen another
  118.                     minesweeper that can have fields with von Neumann
  119.                     grids.  In a von Neumann neighbourhood (grid),
  120.                     each cell/square has only four neighbours, at the edges
  121.                     but not at the corners.
  122.                 </p>
  123.                 <p>
  124.                     The biggest number you'll ever see is 3. But that doesn't
  125.                     mean it's easy, it's quite the opposite.
  126.                 </p>
  127.             </div>
  128.             <div class="atom">
  129.             <h4>Traditional fields with Moore grids</h4>
  130.                 <p>Like any other minsweeper.</p>
  131.             </div>
  132.             <div class="atom">
  133.             <h4>Hexagonal fields</h4>
  134.                 <p>
  135.                     Every cell is a hexagon and has six
  136.                     neighbours, (with obvious exceptions).
  137.                     This mode has separate key bindings because there is no
  138.                     single "up" and single "down" direction.
  139.                 </p>
  140.             </div>
  141.             </div>
  142.             <div class="atom">
  143.             <h3>More features:</h3>
  144.             <ul>
  145.                 <li>
  146.                     It looks almost fine on monochrome terminals.
  147.                 </li>
  148.                 <li>
  149.                     Even the losers can get on their very own highscores table.
  150.                 </li>
  151.                 <li>
  152.                     There are cheat codes. They're not useful, but will be a
  153.                     challenge to crack.
  154.                 </li>
  155.             </ul>
  156.             </div>
  157.             </div></section>
  158.             <section><div class="section" id="download">
  159.             <h2>Download</h2>
  160.             <p class="notprint"><small><a href="#top">To top of the page</a></small></p>
  161.             <p><strong>NOTE</strong>:  Not for smartphones and tablets.</p>
  162.             <p class="notprint bold">
  163.                 <a href="#dl-unix">Linux, macOS, unix-likes, Haiku</a>,
  164.                 <a href="#dl-windows">Windows</a>,
  165.             </p>
  166.             <p><a href="__SITE__/archive/anonymine/?C=M&amp;O=A"
  167.                   class="printurl">Archive of all released versions</a></p>
  168.             <p>
  169.                 If you find any bugs, please <span class="a"><a
  170.                      class="printurl"
  171.                     href="https://gitlab.com/oskog97/anonymine/issues"
  172.                 >create an issue</a>.</span>
  173.             </p>
  174.             <div class="atom">
  175.             <h3 id="dl-unix">GNU/Linux, macOS, *BSD, Cygwin, other unix-like
  176.                              operating systems, and Haiku</h3>
  177.             <ul>
  178.                 <li><a href="__SITE__/archive/anonymine/anonymine-${version}.tar.xz"
  179.                     class="printurl download">xz compressed tarball of version ${version} from ${date}</a></li>
  180.                 <li><a class="printurl"
  181.                     href="https://gitlab.com/oskog97/anonymine/">GitLab</a></li>
  182.                 <li><a href="#release-notes">Release notes</a></li>
  183.             </ul>
  184.             </div>
  185.             <div class="atom">
  186.             <h3 id="dl-windows">Windows</h3>
  187.             <p>There are a few options:</p>
  188.             <ol>
  189.                 <li><strong>Recommended:</strong> WSL (both 1 and 2 work just fine)</li>
  190.                 <li>Automatic Cygwin and Anonymine installer</li>
  191.                 <li>Install Python and windows-curses</li>
  192.             </ol>
  193.             <p><a href="https://gitlab.com/oskog97/anonymine/-/wikis/Windows"
  194.                 >Comparison of options</a></p>
  195.             <h4>Automatic Cygwin installer</h4>
  196.             Downloads:
  197.             <ul>
  198.                 <li><a href="__SITE__/archive/anonymine/windows/Anonymine-Windows-${windows_version}.zip"
  199.                     class="printurl download">Windows installer from ${windows_date}
  200.                     (version $(echo "$windows_version" | cut -d- -f1)
  201.                     with Cygwin setup $(echo "$windows_version" | cut -d- -f3))
  202.                 </a></li>
  203.                 <li><a href="https://gitlab.com/oskog97/anonymine-windows"
  204.                     class="printurl">Fetch newest version from GitLab
  205.                 </a></li>
  206.             </ul>
  207.             <h4>Install Python and windows-curses</h4>
  208.             It is possible to run the unix version with some limitations.
  209.             <ul>
  210.                 <li><a class="printurl"
  211. href="https://gitlab.com/oskog97/anonymine/blob/master/doc/INSTALL.Windows.txt">
  212.                     Instructions</a>
  213.                     </li>
  214.                 <li>You can download as a zip from <span class="a"><a
  215. href="https://gitlab.com/oskog97/anonymine/-/archive/master/anonymine-master.zip"
  216.                     class="printurl">Gitlab</a>.</span></li>
  217.             </ul>
  218.             </div>
  219.             </div></section>
  220.             <section><div class="section" id="screenshots">
  221.             <h2>Screenshots</h2>
  222.             <p class="notprint"><small><a href="#top">To top of the page</a></small></p>
  223.             <p>
  224.                 <img width="484" height="316" alt="" src="imgs4/last-cells.png"/>
  225.                 <br/><span class="caption">
  226.                     The von Neumann field: The biggest number you'll ever see
  227.                     is 3.  This mode makes Anonymine a unique minesweeper.
  228.                     (Attention mode has been enabled to find the last few
  229.                     cells.)
  230.                 </span>
  231.             </p>
  232.             <p>
  233.                 <img width="484" height="316" alt="" src="imgs4/traditional.png"/>
  234.                 <br/><span class="caption">
  235.                     Traditional (Moore) field, nothing special
  236.                 </span>
  237.             </p>
  238.             <p>
  239.                 <img width="484" height="316" alt="" src="imgs4/hexagonal.png"/>
  240.                 <br/><span class="caption">
  241.                     Hexagonal field
  242.                 </span>
  243.             </p>
  244.             <p>
  245.                 <img width="484" height="316" alt="" src="imgs4/losers.png"/>
  246.                 <br/><span class="caption">
  247.                     The losers' highscores
  248.                 </span>
  249.             </p>
  250.             </div></section>
  251.             <section><div class="section" id="platforms">
  252.             <h2>Platforms</h2>
  253.             <p class="notprint"><small><a href="#top">To top of the page</a></small></p>
  254.             <p>
  255.                 Check the <a class="printurl"
  256. href="https://gitlab.com/oskog97/anonymine/-/blob/master/README.md#blob-content-holder"
  257.                 >readme</a> and <a class="printurl"
  258. href="https://gitlab.com/oskog97/anonymine/blob/master/doc/INSTALL.txt"
  259.                 >installation instructions</a> for more details.
  260.             </p>
  261.             <div class="atom">
  262.             <h3>Tested on</h3>
  263.             <p>
  264.                 Here's a list of various platforms Anonymine has been tested
  265.                 on.  It works on all of them unless I say otherwise, but there
  266.                 may be some minor issues.
  267.             </p>
  268.             <ul>
  269.                 <li>Various GNU/Linux distributions</li>
  270.                 <li>FreeBSD, OpenBSD, NetBSD, DragonflyBSD</li>
  271.                 <li>Haiku</li>
  272.                 <li>SerenityOS</li>
  273.                 <li>macOS</li>
  274.                 <li>OpenIndiana and Solaris</li>
  275.                 <li>Debian GNU/Hurd</li>
  276.                 <li>Cygwin (on Windows and ReactOS)</li>
  277.                 <li>Windows and ReactOS (without Cygwin)</li>
  278.             </ul>
  279.             Python interpreters:
  280.             <ul>
  281.                 <li>CPython</li>
  282.                 <li>PyPy (lacks <code>curses</code> on Windows)</li>
  283.             </ul>
  284.             </div>
  285.             <div class="atom">
  286.             <h4>"Some coercion required"</h4>
  287.             <p>
  288.                 Using <span class="a"><a href="http://gitlab.com/oskog97/poop"
  289.                 class="printurl">Pööp</a>,</span> Anonymine can be made to work
  290.                 on even more platforms.
  291.                 <span class="bold">"Do not try this at home"</span>
  292.             </p>
  293.             <dl>
  294.                 <dt>GraalVM Python</dt>
  295.                 <dd>Needs only <code>curses</code></dd>
  296.                 <dt>PyPy on Windows</dt>
  297.                 <dd>Needs only <code>curses</code>,
  298.                     but the Windows console is really slow</dd>
  299.                 <dt>Jython</dt>
  300.                 <dd>Needs <code>curses</code> and <code>multiprocessing</code></dd>
  301.                 <dt>IronPython</dt>
  302.                 <dd>Needs very different configuration files and
  303.                     <code>curses</code> and <code>multiprocessing</code></dd>
  304.                 <dt>Minix 3.4</dt>
  305.                 <dd>Needs <code>multiprocessing</code> and <code>threading</code></dd>
  306.             </dl>
  307.             </div>
  308.             </div></section>
  309. __EOF__
  310. echo;echo;echo
  311. write_news ()
  312. {
  313.     news=~oskar/projects/anonymine/doc/NEWS
  314.     changelog=~oskar/projects/anonymine/ChangeLog
  315.     release_notes=~oskar/projects/anonymine/doc/RELEASE-NOTES
  316.     _get_snippet ()
  317.     {
  318.         _internal ()
  319.         {
  320.             file=$1
  321.             regex=$2
  322.             tailcut=$3
  323.             count=$4
  324.             lim=$5
  325.             n=1
  326.             while [ "$(head -n$n $file | grep -E "$regex" | wc -l)" -le $count ]; do
  327.                 n=$(($n + 1))
  328.             done
  329.             n=$(($n - $tailcut))
  330.             if [ "$n" -lt $(($lim + 1)) ]; then
  331.                 head -n$n $file
  332.             else
  333.                 head -n$lim $file
  334.                 echo '...'
  335.             fi
  336.         }
  337.         _internal "$1" "$2" "$3" "$4" "$5" \
  338.             | sed -e 's/[&]/\&amp;/g' \
  339.             | sed -e 's/[<]/\&lt;/g' \
  340.             | sed -e 's/[>]/\&gt;/g'
  341.     }
  342.     get_news ()
  343.     {
  344.         _get_snippet $news '====' 3 1 30
  345.     }
  346.     get_changelog ()
  347.     {
  348.         _get_snippet $changelog '^    [0-9]+\.[0-9]+\.[0-9]+$' 3 1 7
  349.     }
  350.     get_release_notes ()
  351.     {
  352.         _get_snippet $release_notes '^[0-9]+\.[0-9]+\.[0-9]+' 2 4 30
  353.         # 2 3 15 -> 2 4 25 -> 2 4 30
  354.     }
  355.     cat <<__EOF__
  356.             <section><div class="section" id="news">
  357.                 <h2>What's new?</h2>
  358.                 <p class="notprint"><small><a href="#top">To top of the page</a></small></p>
  359.                 <dl>
  360.                 <dt id="release-notes">Release notes</dt>
  361.                 <dd>
  362.                 <pre>$(get_release_notes)</pre>
  363.                 <p><a class="printurl"
  364.         href="https://gitlab.com/oskog97/anonymine/blob/master/doc/RELEASE-NOTES"
  365.                 >See the rest of the file on Gitlab</a></p>
  366.                 </dd>
  367.                 <dt>Bigger changes</dt>
  368.                 <dd>
  369.                 <pre>$(get_news)</pre>
  370.                 <p><a class="printurl"
  371.         href="https://gitlab.com/oskog97/anonymine/blob/master/doc/NEWS"
  372.                 >See the rest of NEWS on Gitlab</a></p>
  373.                 </dd>
  374.                 <dt>Low level changes</dt>
  375.                 <dd>
  376.                 <p><a class="printurl"
  377.         href="https://gitlab.com/oskog97/anonymine/blob/master/ChangeLog"
  378.                 >See ChangeLog on Gitlab</a></p>
  379.                 </dd>
  380.                 </dl>
  381.             </div></section>
  382. __EOF__
  383. }
  384. write_news
  385. echo;echo;echo
  386. cat <<__EOF__
  387.         </div></main>
  388.         __FOOTER__
  389.     </body>
  390. </html>
  391. __EOF__