build index.html for all winners
Updated manifest as per recent file changes. Updated winner `.winner.json` to reflect the manifest changes. Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over all winning entries. These tools had slight improvements in the help usage message: * bin/gen-author.sh VERSION="1.3.1 2024-01-16" * bin/gen-inventory.sh VERSION="1.0.1 2024-01-16" * bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16" * bin/subst.default.sh VERSION="1.1.1 2024-01-16" * bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16" The `bin/readme2index.sh` tool was improved so that if the `index.html` file exists and the tool forms the exact same content, then the file `index.html` file is NOT touched. * bin/readme2index.sh VERSION="1.1 2024-01-16" We used the following command to generate `index.html` files for all winning entries: ```sh bin/all_run.sh -v 3 bin/readme2index.sh ``` NOTE: We have not (yet) built HTML files above the winner directory level (e.g., no year level nor top level HTML), nor have be built non-index HTML files for winners. NOTE: By default we are running `pandoc(1)` with: ``` --fail-if-warnings=true ``` This means that any problems with markdown to HTML generates an error. This is done to be sure that the HTML conversion is clean. We had to fix the following `README.md` files: * `2000/rince/README.md` The reference [^2] was never used. We made a guess that [^2] applies to the same spot as [^1]. Perhaps there is a better spot where [^2] applies? NOTE: For every reference, there MUST be some place where that reference is used. * 2012/vik/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". * 2018/burton1/README.md The reference [2] was duplicated. We changed the second [2] to [3]. NOTE: Every reference needs to have a unique number. * 2020/carlini/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". We also found 2 errors in the `author/author_handle.json` file set: * author/Anonymous_2001.json The `author/Anonymous_2001.json` file was missing. * author/Jari_Arkko.json The winner ID for `1989_jar.1` had a typo.
This commit is contained in:
1 parent
893cd915b6
commit
c1466f5165
350 files changed
+95242
-4217
No files matched your search
+373
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,385 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 1992/gson/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>1992 gson</title>
|
||||
<meta name="description" content="IOCCC year: 1992 IOCCC winner: gson winner index page">
|
||||
<meta name="keywords" content="IOCCC,1992,gson,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>1992/gson</title>
|
||||
<meta name="description" content="1992 IOCCC winner gson">
|
||||
<meta name="keywords" content="IOCCC, 1992, IOCCC 1992, IOCCC winner, gson">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>1992 gson</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>1992/gson</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1992%2Fgson%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1992/gson/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../buzzard.2/index.html">← buzzard.2</a>
|
||||
<a class="Left" href="../index.html">↑ 1992 ↑</a>
|
||||
<a class="Left" href="../imc/index.html">imc →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Andreas_Gustafsson">Andreas
|
||||
Gustafsson</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#FI">FI</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
|
||||
<p>NOTE: we DISABLE the optimiser because having it enabled causes some
|
||||
invocations to crash in some systems.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: uses gets() - change to fgets() if possible</code></pre>
|
||||
<p>For more detailed information see <a href="/bugs.md#1992-gson">1992
|
||||
gson in bugs.md</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> word word2 word3 <span class="op"><</span> /path/to/dictionary</span></code></pre></div>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>Determine where your system dictionary is located. You may find it
|
||||
located in one of the following places:</p>
|
||||
<pre><code>/usr/share/dict/words
|
||||
/usr/share/lib/spell/words
|
||||
/usr/ucblib/dict/words
|
||||
/dev/null # <-- for machines with nothing to say</code></pre>
|
||||
<p>Then using the proper dictionary:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> free software foundation <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> obfuscated c contest <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> unix international <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> george bush <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> bill clinton <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> ross perot <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> paul e tsongas <span class="op"><</span> /usr/share/dict/words</span></code></pre></div>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Recently some newspapers printed amusing anagrams of one of the names
|
||||
listed above. Run this program to find the anagrams they weren’t allowed
|
||||
to print!</p>
|
||||
<p>The author provided an obfuscated script that can be used to
|
||||
construct dictionaries which has been put in as <a
|
||||
href="mkdict.sh">mkdict.sh</a>. To use try:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> README.md <span class="kw">|</span> <span class="ex">./mkdict.sh</span> <span class="op">></span> words</span></code></pre></div>
|
||||
<p>Then try using the program as shown above with the file
|
||||
<code>words</code>.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<p>The name of the game:</p>
|
||||
<p>AG is short for either Anagram Generator or simply AnaGram. It might
|
||||
also be construed to mean Alphabet Game, and by pure coincidence it
|
||||
happens to be the author’s initials.</p>
|
||||
<h3 id="what-it-does">What it does</h3>
|
||||
<p>AG takes one or more words as arguments, and tries to find anagrams
|
||||
of those words, i.e. words or sentences containing exactly the same
|
||||
letters.</p>
|
||||
<h3 id="how-to-use-it">How to use it</h3>
|
||||
<p>To run AG, you need a dictionary file consisting of distinct words in
|
||||
the natural language of your choice, one word on each line. If your
|
||||
machine doesn’t have one already, you can make your own dictionary by
|
||||
concatenating a few hundred of your favourite Usenet articles and piping
|
||||
them through the following obfuscated shell script:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co">#!/bin/sh</span></span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="va">z</span><span class="op">=</span>a-z]<span class="kw">;</span><span class="fu">tr</span> [A-Z<span class="dt">\]</span> <span class="dt">\[</span><span class="va">$z</span><span class="kw">|</span><span class="fu">sed</span> s/[<span class="dt">\^</span><span class="va">$z</span>[<span class="dt">\^</span><span class="va">$z</span><span class="pp">*</span>/_/g<span class="kw">|</span><span class="fu">tr</span> _ <span class="dt">\\</span>012<span class="kw">|</span><span class="fu">grep</span> ..<span class="kw">|</span><span class="fu">sort</span> <span class="at">-u</span></span></code></pre></div>
|
||||
<p>Using articles from alt.folklore.computers is likely to make a more
|
||||
professional-looking dictionary than rec.arts.erotica.</p>
|
||||
<p>AG must be run with the dictionary file as standard input.</p>
|
||||
<p>Because anagrams consisting of just a few words are generally more
|
||||
meaningful than those consisting of dozens of very short words, the
|
||||
number of words in the anagrams is limited to 3 by default. This limit
|
||||
can be changed using a numeric command line option, as in
|
||||
<code>./ag -4 international obfuscated c code contest </usr/dict/words</code>.</p>
|
||||
<h3 id="bugs-and-limitations">Bugs and limitations</h3>
|
||||
<ul>
|
||||
<li>There is no error checking.</li>
|
||||
<li>Standard input must be seekable, so you can’t pipe the dictionary
|
||||
into AG.</li>
|
||||
<li>The input sentence and each line in the dictionary may contain at
|
||||
most 32 distinct letters, and each letter may occur at most 15
|
||||
times.</li>
|
||||
<li>Words in the dictionary may be at most 255 bytes long.</li>
|
||||
<li>AG cannot handle characters that sign-extend to negative
|
||||
values.</li>
|
||||
<li>Although AG works on both 16-bit and 32-bit machines, the size of
|
||||
the problems it can solve is severely limited on machines that limit the
|
||||
stack size to 64k or less.</li>
|
||||
</ul>
|
||||
<h3 id="obfuscatory-notes">Obfuscatory notes</h3>
|
||||
<p>As you can see, AG takes advantage of the new ‘92 whitespace rules’
|
||||
to achieve a clear, readable, self-documenting layout. The identifiers
|
||||
have been chosen in a way appropriate for an alphabet game, and common
|
||||
sources of bugs such as goto statements and malloc/free have been
|
||||
eliminated. As AG also refrains from abusing the preprocessor, it
|
||||
doesn’t really have much to offer in terms of “surface obfuscation”.
|
||||
Instead, it tries to achieve both its speed and its obscurity through a
|
||||
careful choice of algorithms. Some of the finer points of those
|
||||
algorithms are outlined in the spoiler below.</p>
|
||||
<h3 id="how-it-works">How it works:</h3>
|
||||
<p>Here follows a description of some of the data structures and
|
||||
algorithms used by AG. It is by no means complete, but it may help you
|
||||
get an idea about the general principles.</p>
|
||||
<hr />
|
||||
<p>Internally, AG represents words and sentences as arrays of 32 4-bit
|
||||
integer elements. Each element represents the number of times a letter
|
||||
occurs in the word/sentence. There are 32 elements because 32 is a
|
||||
convenient power of two larger than the number of letters in most
|
||||
western alphabets, and the elements are 4 bits each because the same
|
||||
letter is unlikely to occur more than 15 times in a practical anagram
|
||||
generation problem.</p>
|
||||
<p>These <code>32*4</code>-bit arrays are actually stored in memory in a
|
||||
“bit-transposed” format, as arrays of four <code>long</code> values. It
|
||||
is assumed that a <code>long</code> is at least 32 bits. The first 4-bit
|
||||
letter count is formed by the least significant (<code>2^0</code>) bit
|
||||
in each of the four <code>long</code>s, the next one is formed by the
|
||||
<code>2^1</code> bits, etc.</p>
|
||||
<p>This storage format makes it possible to add or subtract two such
|
||||
vectors of 32 4-bit values in parallel by simulating a set of 32 binary
|
||||
full adders in software using bitwise logical operations. E.g., all the
|
||||
LSBs of the result are formed in parallel by taking the exclusive OR of
|
||||
the LSBs in each summand, and 32 carry bits are formed in parallel in a
|
||||
similar way using a logical AND. Thus, 32 independent 4-bit additions
|
||||
can be performed by just four iterations of a loop containing some
|
||||
32-bit bitwise logical operations, but no arithmetic operations other
|
||||
than those implied by array indexing.</p>
|
||||
<p>Subtraction works similarly, and in fact AG only implements
|
||||
subtraction directly, handling addition by means of the identity
|
||||
<code>a+b = a-(0-b)</code>.</p>
|
||||
<p>In addition to this <code>32*4</code>-bit representation, AG also
|
||||
forms a so-called “signature” that is the bitwise OR of the four
|
||||
<code>long</code>s, which is equivalent to saying that the signature of
|
||||
a word contains a logical 1 in the bit positions corresponding to
|
||||
letters occurring at least once in that word.</p>
|
||||
<p>The first thing AG does is to construct a lookup table of 256
|
||||
<code>long</code>s, one for each 8-bit character value. The entry for a
|
||||
character will be zero if that character doesn’t appear in the sentence
|
||||
given on the command line, or it will have a single bit set if the
|
||||
character does appear in the sentence. By adding together the bit masks
|
||||
for all the letters in the input sentence using the transpose addition
|
||||
method described above, AG forms the <code>32*4</code> bit array
|
||||
representation of the input sentence.</p>
|
||||
<p>The next action performed is reading the dictionary. Those words that
|
||||
contain letters not in the input sentence are immediately discarded.
|
||||
Words containing the right letters but in excessive numbers are
|
||||
eliminated in a separate check involving the <code>32*4</code> bit
|
||||
array.</p>
|
||||
<p>The remaining words, which will be referred to as “candidate words”,
|
||||
are stored in <code>32*4</code>-bit representation, together with their
|
||||
signatures and offsets into the dictionary file so that the plain-text
|
||||
version of a word can later be found for printing. This information is
|
||||
kept in a local <code>struct</code> in the dictionary-reading function,
|
||||
and memory is allocated for each candidate word simply by making another
|
||||
recursive call to that function.</p>
|
||||
<p>Each <code>struct</code> so allocated is linked into a fixed-size
|
||||
hash table of 4096 entries indexed by the 12 low bits of the word’s
|
||||
signature. When the dictionary-reading function encounters end-of-file,
|
||||
all the candidate words have been stored in nested activation records on
|
||||
the stack, accessible through the hash table.</p>
|
||||
<p>Generating the anagrams is then done by traversing the hash table and
|
||||
subtracting the letters of each word in the hash table from the “current
|
||||
sentence”, which initially is the sentence given on the command
|
||||
line.</p>
|
||||
<p>The subtraction is performed in parallel on the 4-bit letter counts
|
||||
as described above, and if all 32 results are zero, an anagram has been
|
||||
found. If the result is negative for one or more of the letters (as
|
||||
indicated by one or more <code>1</code>s in a vector of 32 borrow bits
|
||||
returned by the subtraction routine), the word did not match the current
|
||||
sentence and is ignored. Finally, if the result contained only
|
||||
non-negative letter counts, we have found a partial anagram: a word
|
||||
containing some, but not all, of the letters in the current sentence. In
|
||||
this case we recursively try to find an anagram of the remaining
|
||||
letters. The depth of the recursion is limited to the maximum number of
|
||||
words in the anagram, as specified by the user.</p>
|
||||
<p>When the deepest recursion level has been reached, an optimization
|
||||
can be applied: because no further recursion will be done, there is no
|
||||
need to look for partial anagrams, and therefore AG only needs to check
|
||||
for words that contain exactly the same letters as the current sentence.
|
||||
Those words can be found simply by indexing the hash table with the
|
||||
signature of the current sentence.</p>
|
||||
<p>Even when not on the deepest recursion level, AG generally avoids
|
||||
examining all the entries of the hash table. The idea is that we are not
|
||||
interested in hash buckets whose words contain any letters not in the
|
||||
current sentence; these buckets are exactly those whose index has a
|
||||
logical one in a bit position where the signature of the current
|
||||
sentence has a zero. Put another way, we want to loop through only those
|
||||
hash bucket indices <code>i</code> that contain zeroes in all the bit
|
||||
positions where the signature <code>s</code> of the current sentence
|
||||
contains a zero; this can be expressed in C as
|
||||
(<code>i & ~s == 0</code>).</p>
|
||||
<p>It is possible to loop through all such numbers in an efficient way
|
||||
by taking advantage of certain properties of binary arithmetic: by
|
||||
forcing the bits corresponding to zeroes in <code>s</code> to ones, we
|
||||
can make the carries generated in incrementing <code>i</code> propagate
|
||||
straight across those bits that should remain zero. For example, the
|
||||
following program prints all those 16-bit integers that contain zeroes
|
||||
in all even bit positions:</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>main<span class="op">(){</span><span class="dt">int</span> i<span class="op">=</span><span class="dv">0</span><span class="op">,</span>s<span class="op">=</span><span class="bn">0xAAAA</span><span class="op">;</span><span class="cf">do</span><span class="op">{</span>printf<span class="op">(</span><span class="st">"</span><span class="sc">%04x\t</span><span class="st">"</span><span class="op">,</span>i<span class="op">);}</span><span class="cf">while</span><span class="op">(</span>i<span class="op">=((</span>i<span class="op">|~</span>s<span class="op">)+</span><span class="dv">1</span><span class="op">)&</span>s<span class="op">);}</span></span></code></pre></div>
|
||||
<p>AG uses a similar method but works in the opposite direction, finding
|
||||
the next lower value with zeroes in given bit positions by propagating
|
||||
borrows across those bits. Some additional adjustments are made to the
|
||||
hash table index when initiating a recursive search, using similar
|
||||
bit-twiddling techniques.</p>
|
||||
<p>Whenever an anagram has been found, it is printed by traversing a
|
||||
linked list formed by <code>struct</code>s in the activation records of
|
||||
the recursive invocations of the search function, seeking to the
|
||||
beginning of the word matched by that invocation, and copying the
|
||||
characters of the word directly from standard input to standard
|
||||
output.</p>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
|
||||
License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
|
||||
Reserved. You are free to share and adapt this file under the terms of
|
||||
this license:</p>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-1992gson"><a name="inventory"></a>Inventory for
|
||||
1992/gson</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/gson.c">gson.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/Makefile">Makefile</a>
|
||||
- winner Makefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/gson.orig.c">gson.orig.c</a>
|
||||
- original source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/try.sh">try.sh</a>
|
||||
- how to run</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/mkdict.sh">mkdict.sh</a>
|
||||
- tool to make the dictionary</li>
|
||||
<li><a href="1992_gson.tar.bz2">1992_gson.tar.bz2</a> - download winning
|
||||
source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/.gitignore">.gitignore</a>
|
||||
- list of files that should not be committed under git</li>
|
||||
<li><a href=".path">.path</a> - directory path from top directory</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1992/gson/README.md">README.md</a>
|
||||
- markdown source for index.html</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1992%2Fgson%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
Reference in new issue
Block a user