force use of pandoc version >= 3.1.12.2
The `bin/pandoc-wrapper.sh` tool will verify that the ssytem has a recent enough version of `pandoc(1)`. We explain why we insist on `pandoc(1)`. version >= 3.1.12.2 in comments where the $PANDOC_MIN_VERSION is set. Added `--wrap=preserve` as a default argument to `pandoc(1)`. While this change will impact every HTML file generated, we believe this will improve the ability of someone to look at the generated HTML and correlate with the original markdown. Changed `bin/pandoc-wrapper.sh` VERSION from "1.4.2 2024-03-17" to "1.4.3 2024-03-18". Performed `make www` to achieve all of the above and to generate HTML using the new `--wrap=preserve` `pandoc(1)` mode.
This commit is contained in:
1 parent
9eb7a54e9f
commit
b0b212acb1
402 files changed
+37061
-55132
No files matched your search
+47
-107
@@ -145,139 +145,79 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="op">></span> foo.c</span></code></pre></div>
|
||||
<h2 id="try">Try:</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">./try.sh</span></span></code></pre></div>
|
||||
<p>The script will ask you if you wish to run <code>make rake</code> but
|
||||
this is not necessary to fully enjoy the entry. <code>make rake</code>
|
||||
will run the <a href="rake.sh">rake.sh</a> script and then
|
||||
<code>prog</code> if all is built okay. If <code>rake</code> is not
|
||||
installed then it will check that <code>gem</code> is installed. If
|
||||
<code>gem</code> is not installed it will tell you where to get it and
|
||||
then tell you how to install <code>rake</code>. Otherwise, if
|
||||
<code>rake</code> is installed it will try running <code>rake</code> and
|
||||
if that fails to run it will tell you to run a <code>gem</code> command
|
||||
as either root or via sudo and then to try running
|
||||
<code>make rake</code> or <code>./rake.sh</code> again. If
|
||||
<code>rake</code> succeeds it will run <code>./prog</code> which can be
|
||||
used to build <code>main.c</code>.</p>
|
||||
<p>What is the difference between running <code>./prog</code> and
|
||||
<code>main</code>?</p>
|
||||
<p>The script will ask you if you wish to run <code>make rake</code> but this is not necessary
|
||||
to fully enjoy the entry. <code>make rake</code> will run the <a href="rake.sh">rake.sh</a> script and
|
||||
then <code>prog</code> if all is built okay. If <code>rake</code> is not installed then it will check
|
||||
that <code>gem</code> is installed. If <code>gem</code> is not installed it will tell you where to get
|
||||
it and then tell you how to install <code>rake</code>. Otherwise, if <code>rake</code> is installed it
|
||||
will try running <code>rake</code> and if that fails to run it will tell you to run a
|
||||
<code>gem</code> command as either root or via sudo and then to try running <code>make rake</code> or
|
||||
<code>./rake.sh</code> again. If <code>rake</code> succeeds it will run <code>./prog</code> which can be used to
|
||||
build <code>main.c</code>.</p>
|
||||
<p>What is the difference between running <code>./prog</code> and <code>main</code>?</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Big terminals with tiny fonts have their uses in certain cases. One
|
||||
of them is:</p>
|
||||
<p>Big terminals with tiny fonts have their uses in certain cases.
|
||||
One of them is:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> treacl</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./treacl</span></span></code></pre></div>
|
||||
<p>which is shorthand for:</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">./prog</span> <span class="op"><</span> prog.c <span class="op">></span> treacle.c</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> treacle</span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./treacle</span></span></code></pre></div>
|
||||
<p>When using a smartphone to read the output, you may need to step back
|
||||
to see the bigger picture because that picture is worth more than 1000
|
||||
words.</p>
|
||||
<p>When using a smartphone to read the output, you may need to
|
||||
step back to see the bigger picture because that picture is worth
|
||||
more than 1000 words.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="remarks">Remarks</h3>
|
||||
<p>You may want to use a large display with a very small terminal
|
||||
font.</p>
|
||||
<p>You may want to use a large display with a very small terminal font.</p>
|
||||
<h3 id="spoiler">Spoiler</h3>
|
||||
<p>See <a href="spoilers.html">spoilers.html</a>.</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>
|
||||
<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>
|
||||
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
|
||||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||||
|
||||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2014endoh1"><a name="inventory"></a>Inventory for
|
||||
2014/endoh1</h1>
|
||||
<h1 id="inventory-for-2014endoh1"><a name="inventory"></a>Inventory for 2014/endoh1</h1>
|
||||
<p><a href="#top">Jump to top</a></p>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/prog.c">prog.c</a>
|
||||
- entry source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/Makefile">Makefile</a>
|
||||
- entry Makefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/prog.orig.c">prog.orig.c</a>
|
||||
- original source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/Rakefile">Rakefile</a>
|
||||
- Ruby makefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/rake.sh">rake.sh</a>
|
||||
- make rake script</li>
|
||||
<li><a href="spoilers.html">spoilers.html</a> - spoilers about Q(uine)R
|
||||
code generator</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/try.sh">try.sh</a>
|
||||
- how to run</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/alpha.rb">alpha.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/assemble.rb">assemble.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/ast-def.rb">ast-def.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/gen-prog.rb">gen-prog.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/gen-table.rb">gen-table.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/link.rb">link.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/machine.rb">machine.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/parse.rb">parse.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/prog-tmpl.c">prog-tmpl.c</a>
|
||||
- source code template used by gen-prog</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/register.rb">register.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/serialize.rb">serialize.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/src.rb">src.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/tool.rb">tool.rb</a>
|
||||
- support program for Rakefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/vm.c">vm.c</a>
|
||||
- source code of the VM</li>
|
||||
<li><a href="2014_endoh1.tar.bz2">2014_endoh1.tar.bz2</a> - download
|
||||
entry source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/prog.c">prog.c</a> - entry source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/Makefile">Makefile</a> - entry Makefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/prog.orig.c">prog.orig.c</a> - original source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/Rakefile">Rakefile</a> - Ruby makefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/rake.sh">rake.sh</a> - make rake script</li>
|
||||
<li><a href="spoilers.html">spoilers.html</a> - spoilers about Q(uine)R code generator</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/try.sh">try.sh</a> - how to run</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/alpha.rb">alpha.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/assemble.rb">assemble.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/ast-def.rb">ast-def.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/gen-prog.rb">gen-prog.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/gen-table.rb">gen-table.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/link.rb">link.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/machine.rb">machine.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/parse.rb">parse.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/prog-tmpl.c">prog-tmpl.c</a> - source code template used by gen-prog</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/register.rb">register.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/serialize.rb">serialize.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/src.rb">src.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/tool.rb">tool.rb</a> - support program for Rakefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/vm.c">vm.c</a> - source code of the VM</li>
|
||||
<li><a href="2014_endoh1.tar.bz2">2014_endoh1.tar.bz2</a> - download entry source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - entry home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/.entry.json">.entry.json</a>
|
||||
- description of entry in JSON</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/.gitignore">.gitignore</a>
|
||||
- list of files that should not be committed under git</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/.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/2014/endoh1/README.md">README.md</a>
|
||||
- markdown source for index.html</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/spoilers.md">spoilers.md</a>
|
||||
- markdown source for spoilers.html</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/README.md">README.md</a> - markdown source for index.html</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2014/endoh1/spoilers.md">spoilers.md</a> - markdown source for spoilers.html</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
+42
-65
@@ -122,38 +122,32 @@
|
||||
|
||||
<h1 id="quiner-code-generator">Q(uine)R code generator</h1>
|
||||
<h2 id="what-is-difficult">What is difficult?</h2>
|
||||
<p>As you may know, QR code (specification: ISO/IEC 18004) is quite
|
||||
complex. It requires a bit stream, Reed-Solomon codes, BCH codes, data
|
||||
relocation, big (and irregular!) numerical tables, human-oriented
|
||||
pattern arrangement (difficult to implement by a small program),
|
||||
etc.</p>
|
||||
<p>On the other hand, a quine has a big restriction: it needs to have
|
||||
two copies of the program!</p>
|
||||
<p>Do you think that it is possible to write QR code encoder in C within
|
||||
<em>1kB</em>?</p>
|
||||
<p>As you may know, QR code (specification: ISO/IEC 18004) is quite complex. It
|
||||
requires a bit stream, Reed-Solomon codes, BCH codes, data relocation, big (and
|
||||
irregular!) numerical tables, human-oriented pattern arrangement (difficult to
|
||||
implement by a small program), etc.</p>
|
||||
<p>On the other hand, a quine has a big restriction: it needs to have two copies of
|
||||
the program!</p>
|
||||
<p>Do you think that it is possible to write QR code encoder in C within <em>1kB</em>?</p>
|
||||
<h2 id="how-did-i-achieve-that">How did I achieve that?</h2>
|
||||
<p>It is known that we can mitigate the quine restriction by
|
||||
<code>eval</code>. For example, this is a quine written in Ruby:</p>
|
||||
<div class="sourceCode" id="cb1"><pre
|
||||
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">eval</span> s<span class="kw">=</span><span class="st">"print 'eval s='; p s"</span></span></code></pre></div>
|
||||
<p>It is known that we can mitigate the quine restriction by <code>eval</code>.
|
||||
For example, this is a quine written in Ruby:</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">eval</span> s<span class="kw">=</span><span class="st">"print 'eval s='; p s"</span></span></code></pre></div>
|
||||
<p>Note that <code>print</code> appears just once in the program.</p>
|
||||
<p>To emulate this approach in C, I adopted the following structure.</p>
|
||||
<pre><code>char s[]="<main code>int main() { <VM code> }";
|
||||
int main() { <VM code>; }</code></pre>
|
||||
<ul>
|
||||
<li><code><VM code></code> : An own VM implementation (written in
|
||||
C) that executes the main code.</li>
|
||||
<li><code><main code></code> : An object code of quine and QR code
|
||||
encoder (written in the assembly language of the VM).</li>
|
||||
<li><code><VM code></code> : An own VM implementation (written in C) that executes the main
|
||||
code.</li>
|
||||
<li><code><main code></code> : An object code of quine and QR code encoder (written in the
|
||||
assembly language of the VM).</li>
|
||||
</ul>
|
||||
<p><code><main code></code> (about 1100 bytes) appears once and
|
||||
<code><VM code></code> (about 450 bytes) appears twice. So the
|
||||
whole code is about 1100 + 450 * 2 = 2000 bytes. Hooray!</p>
|
||||
<p><code><main code></code> (about 1100 bytes) appears once and <code><VM code></code> (about 450 bytes)
|
||||
appears twice. So the whole code is about 1100 + 450 * 2 = 2000 bytes. Hooray!</p>
|
||||
<h2 id="what-sort-of-vm-is-that">What sort of VM is that?</h2>
|
||||
<p>The VM is a kind of stack machine which makes the object code
|
||||
compact. The instruction set is carefully selected to minimize the sizes
|
||||
of both <code><main code></code> and
|
||||
<code><VM code></code>.</p>
|
||||
<p>The VM is a kind of stack machine which makes the object code compact. The
|
||||
instruction set is carefully selected to minimize the sizes of both <code><main code></code> and <code><VM code></code>.</p>
|
||||
<ul>
|
||||
<li>21 integer registers access
|
||||
<ul>
|
||||
@@ -178,22 +172,17 @@ of both <code><main code></code> and
|
||||
<li>putchar, exit</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p>The instructions have variable lengths, but many of them are
|
||||
represented as one printable character. (See <a
|
||||
href="machine.rb">machine.rb</a> and <a
|
||||
href="assemble.rb">assemble.rb</a> in detail.) The mapping between
|
||||
instructions and characters is also carefully designed to minimize
|
||||
<code><VM code></code>, which makes the resulted program
|
||||
non-human-readable.</p>
|
||||
<h2 id="how-did-i-create-the-main-code">How did I create the main
|
||||
code?</h2>
|
||||
<p>It is too tedious to write the machine language directly. So I wrote
|
||||
the source code in Ruby syntax and created a Ruby-to-VM compiler that
|
||||
involves alpha renaming and automatic register allocation only for this
|
||||
purpose.</p>
|
||||
<p>The instructions have variable lengths, but many of them are represented as one
|
||||
printable character. (See <a href="machine.rb">machine.rb</a> and
|
||||
<a href="assemble.rb">assemble.rb</a> in detail.) The mapping between instructions and
|
||||
characters is also carefully designed to minimize <code><VM code></code>, which makes the
|
||||
resulted program non-human-readable.</p>
|
||||
<h2 id="how-did-i-create-the-main-code">How did I create the main code?</h2>
|
||||
<p>It is too tedious to write the machine language directly. So I wrote the source
|
||||
code in Ruby syntax and created a Ruby-to-VM compiler that involves alpha
|
||||
renaming and automatic register allocation only for this purpose.</p>
|
||||
<ul>
|
||||
<li><a href="src.rb">src.rb</a>: the source code of QR code encoder
|
||||
written in Ruby syntax.</li>
|
||||
<li><a href="src.rb">src.rb</a>: the source code of QR code encoder written in Ruby syntax.</li>
|
||||
<li><a href="vm.c">vm.c</a>: the source code of the VM.</li>
|
||||
</ul>
|
||||
<p>The compiler tool chain is the following.</p>
|
||||
@@ -230,39 +219,28 @@ raw.txt |
|
||||
prog.c</code></pre>
|
||||
<ul>
|
||||
<li><a href="parse.rb">parse.rb</a> converts Ruby to AST.</li>
|
||||
<li><a href="serialize.rb">serialize.rb</a> converts AST to intermediate
|
||||
instruction sequence.</li>
|
||||
<li><a href="alpha.rb">alpha.rb</a> applies “alpha-renaming” to the
|
||||
instruction sequence.</li>
|
||||
<li><a href="register.rb">register.rb</a> applies “register
|
||||
allocation”.</li>
|
||||
<li><a href="assemble.rb">assemble.rb</a> converts the sequence to the
|
||||
final stack-machine instructions.</li>
|
||||
<li><a href="serialize.rb">serialize.rb</a> converts AST to intermediate instruction sequence.</li>
|
||||
<li><a href="alpha.rb">alpha.rb</a> applies “alpha-renaming” to the instruction sequence.</li>
|
||||
<li><a href="register.rb">register.rb</a> applies “register allocation”.</li>
|
||||
<li><a href="assemble.rb">assemble.rb</a> converts the sequence to the final stack-machine instructions.</li>
|
||||
<li><a href="interp.c">interp.c</a> is an implementation of the VM.</li>
|
||||
<li><a href="link.rb">link.rb</a> generates <code>main.c</code> by
|
||||
linking the instructions and interpreter source.</li>
|
||||
<li><a href="gen-prog.c">gen-prog.c</a> generates <a
|
||||
href="prog.c">prog.c</a> based on <code>main.c</code>.</li>
|
||||
<li><a href="link.rb">link.rb</a> generates <code>main.c</code> by linking the instructions and interpreter source.</li>
|
||||
<li><a href="gen-prog.c">gen-prog.c</a> generates <a href="prog.c">prog.c</a> based on <code>main.c</code>.</li>
|
||||
</ul>
|
||||
<p>You can run the process by <code>rake</code> command.
|
||||
<code>ruby-minisat</code> gem is needed.</p>
|
||||
<p>You can run the process by <code>rake</code> command. <code>ruby-minisat</code> gem is needed.</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> gem install ruby-minisat</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> rake</span></code></pre></div>
|
||||
<h2 id="tools">Tools</h2>
|
||||
<p>I checked that the following QR code readers can read the output of
|
||||
my program.</p>
|
||||
<p>I checked that the following QR code readers can read the output of my program.</p>
|
||||
<ul>
|
||||
<li>Linux: <a href="http://zbar.sourceforge.net/">ZBar bar code
|
||||
reader</a>.</li>
|
||||
<li>Linux: <a href="http://zbar.sourceforge.net/">ZBar bar code reader</a>.</li>
|
||||
</ul>
|
||||
<h3 id="a-note-from-the-judges-in-2023">A note from the judges in
|
||||
2023:</h3>
|
||||
<p>The author also tested an Android app called Barcode Scanner which
|
||||
used to be found at
|
||||
<h3 id="a-note-from-the-judges-in-2023">A note from the judges in 2023:</h3>
|
||||
<p>The author also tested an Android app called Barcode Scanner which used to be
|
||||
found at
|
||||
<code>https://play.google.com/store/apps/details?id=com.google.zxing.client.android</code>
|
||||
but it appears to no longer exist.</p>
|
||||
<p>You can use <a href="tool.rb">tool.rb</a> to convert the output to a
|
||||
png file.</p>
|
||||
<p>You can use <a href="tool.rb">tool.rb</a> to convert the output to a png file.</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">./main</span> Hello <span class="kw">|</span> <span class="ex">ruby</span> tool.rb <span class="op">></span> hello.png</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> zbarimg <span class="at">-q</span> hello.png</span>
|
||||
@@ -273,8 +251,7 @@ png file.</p>
|
||||
<h2 id="limitations">Limitations</h2>
|
||||
<ul>
|
||||
<li>QR code error correction level is fixed to L (Low).</li>
|
||||
<li>It supports only byte mode (not numeric, alphanumeric, kanji
|
||||
mode…).</li>
|
||||
<li>It supports only byte mode (not numeric, alphanumeric, kanji mode…).</li>
|
||||
<li>The mask pattern is fixed to 4.</li>
|
||||
<li>The mask is not applied to the remained bits.</li>
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user