Remove hint.html and index.html
As per discussions on GitHub the index.html and hint.html files should be deleted in favour of README.md files (from any .text/.txt/.markdown/.md files which will be turned into README.md in an upcoming commit).
This commit is contained in:
1 parent
ee8a36310f
commit
77fb0f11a2
143 files changed
-28606
No files matched your search
@@ -1,143 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="GENERATOR" content="mkd2html 2.1.5a DL=DISCOUNT">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="../hint.css">
|
||||
<title>Most Complete Use of CPP</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Most Complete Use of CPP</h1>
|
||||
|
||||
<p>Dominik Muth <a href="mailto:muth.ioccc@freenet.de">muth.ioccc@freenet.de</a></p>
|
||||
|
||||
<h2>Judges' comments:</h2>
|
||||
|
||||
<h3>To use:</h3>
|
||||
|
||||
<pre><code>make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run
|
||||
</code></pre>
|
||||
|
||||
<h3>Try:</h3>
|
||||
|
||||
<pre><code>make -B V=2 run
|
||||
|
||||
strings prog | grep '(,)'
|
||||
|
||||
make -B MACHINE=machine_times2.h TAPE=tape_five.h V=1 run
|
||||
|
||||
make -B MACHINE=machine_chaos_5_2.h X=5 run
|
||||
</code></pre>
|
||||
|
||||
<h3>Selected Judges Remarks:</h3>
|
||||
|
||||
<p>This is something we were fearing all along: that the C preprocessor is Turing-complete
|
||||
even without conditionals and recursive file inclusion as some kind of a
|
||||
<a href="https://en.wikipedia.org/wiki/Rewriting">rewriting system</a>. Now we have the proof!</p>
|
||||
|
||||
<h2>Author’s comments:</h2>
|
||||
|
||||
<h3>Preprocessor Turing Engine</h3>
|
||||
|
||||
<h4>Features</h4>
|
||||
|
||||
<ul>
|
||||
<li>Turing machine runs in preprocessor</li>
|
||||
<li>universal (unlimited configurable states, symbols, and tape)</li>
|
||||
<li>no <code>#if</code>s or other conditional directives, only <code>#define</code>s</li>
|
||||
<li>no recursive <code>#include</code></li>
|
||||
<li>single compiler run (no repeated preprocessing)</li>
|
||||
<li>no variadic macros</li>
|
||||
<li>verbosity levels:
|
||||
|
||||
<ul>
|
||||
<li><code>V=0</code> (default) only prints the final tape</li>
|
||||
<li><code>V=1</code> additionally prints one tilde character per machine step (slow)</li>
|
||||
<li><code>V=2</code> additionally prints details on each machine step (slow; generates large files)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>make target <code>run</code> runs <code>./prog</code> and filters a little statistics out of the verbose output</li>
|
||||
<li><code>X</code> (defaults to 3) sets the maximum number of steps: <em>M</em>(<code>X</code>) ~ 8<sup><code>X</code></sup></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h4>Limitations</h4>
|
||||
|
||||
<p>If the machine does not halt after <em>M</em>(<code>X</code>) steps, you will see unexpanded macros in the output.</p>
|
||||
|
||||
<h4>Compiler warnings</h4>
|
||||
|
||||
<p>If <code>V=1</code> or <code>V=2</code> is used, you may see “<code>warning: string length is greater than the length '4095' ISO C99 compilers are required to support</code>”.</p>
|
||||
|
||||
<h4>Programming</h4>
|
||||
|
||||
<p>Implementing your own Turing machine is easy. Take a look at the supplied header files for examples.</p>
|
||||
|
||||
<h5>Tape Symbols</h5>
|
||||
|
||||
<p>Every symbol used (except “<code>_</code>”) must be explicitly declared using</p>
|
||||
|
||||
<pre><code>#define sym_SYMBOL(sym, _SYMBOL) sym
|
||||
</code></pre>
|
||||
|
||||
<p>Example:</p>
|
||||
|
||||
<pre><code>#define sym_1(sym, _1) sym
|
||||
</code></pre>
|
||||
|
||||
<h5>Tape</h5>
|
||||
|
||||
<p>The initial content of the tape must be defined in the tape header using a triple like:</p>
|
||||
|
||||
<pre><code>#define tape ((((,),...l2), l1), c, (r1, (r2..., (,))))
|
||||
</code></pre>
|
||||
|
||||
<ul>
|
||||
<li><code>l1</code>, <code>l2</code>, … are the symbols to the left</li>
|
||||
<li><code>c</code> is the symbol at the current position</li>
|
||||
<li><code>r1</code>, <code>r2</code>, … are the symbols to the right</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>The empty pairs “<code>(,)</code>” represent the continuations of the tape, filled with underscore symbols (“<code>_</code>”). They are expanded on demand.</p>
|
||||
|
||||
<h5>State Machine</h5>
|
||||
|
||||
<p>All transitions are defined in the machine header using the syntax</p>
|
||||
|
||||
<pre><code>#define CURRENT_SCANNED (WRITE, MOVEMENT, NEXT)
|
||||
</code></pre>
|
||||
|
||||
<p>where</p>
|
||||
|
||||
<ul>
|
||||
<li><code>CURRENT</code> is the current state</li>
|
||||
<li><code>SCANNED</code> is the symbol at the current position</li>
|
||||
<li>the whitespace before the parentheses is significant</li>
|
||||
<li><code>WRITE</code> is the symbol to be written to the tape</li>
|
||||
<li><code>MOVEMENT</code> is “<code>L</code>” for left, “<code>R</code>” for right, or nothing</li>
|
||||
<li><code>NEXT</code> is the next state</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>There must be a state “<code>A</code>” defined, which becomes the initial state of the machine.</p>
|
||||
|
||||
<p>To halt the machine, use the keyword “<code>break</code>” as in</p>
|
||||
|
||||
<pre><code>#define A_1 (2, break)
|
||||
</code></pre>
|
||||
|
||||
<hr />
|
||||
|
||||
<TABLE><TR>
|
||||
<TD><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a></TD>
|
||||
<TD><P>© Copyright 1984-2016,
|
||||
<A HREF="/judges.html">Leo Broukhis, Simon Cooper, Landon Curt Noll</A>
|
||||
- All rights reserved<BR>
|
||||
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
|
||||
<TD> <!--<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>--></TD>
|
||||
</TR></TABLE>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user