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,215 +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>Best Handwriting</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Best Handwriting</h1>
|
||||
|
||||
<p>Etienne Duble <a href="mailto:etienne.duble@imag.fr">etienne.duble@imag.fr</a><br>
|
||||
<a href="http://lig-membres.imag.fr/duble">http://lig-membres.imag.fr/duble</a></p>
|
||||
|
||||
<h2>Judges' comments:</h2>
|
||||
|
||||
<h3>To use:</h3>
|
||||
|
||||
<pre><code>make
|
||||
|
||||
echo Some text | ./prog
|
||||
</code></pre>
|
||||
|
||||
<h3>Try:</h3>
|
||||
|
||||
<pre><code>echo Hello, world | ./prog
|
||||
|
||||
DRAFT=1 ./prog < prog.c
|
||||
|
||||
./prog
|
||||
> [type]
|
||||
(...observe...)
|
||||
|
||||
./prog < prog.c
|
||||
</code></pre>
|
||||
|
||||
<h3>Selected Judges Remarks:</h3>
|
||||
|
||||
<p>Beautiful penmanship! However, your fonts may vary.</p>
|
||||
|
||||
<p>How does this entry compress the font it uses? What’s the purpose of lrand48()?
|
||||
Why does the program dump core, when it does :) ?</p>
|
||||
|
||||
<h2>Author’s comments:</h2>
|
||||
|
||||
<h3>Introduction</h3>
|
||||
|
||||
<p>This program <strong>prints text in your terminal with an interesting
|
||||
hand-writing effect</strong>.</p>
|
||||
|
||||
<p>It uses the <em>braille patterns</em> range of the unicode standard: this
|
||||
allows to consider each terminal character as a tiny 2x4 bitmap.</p>
|
||||
|
||||
<p>Turning the Braille code into something visual might be considered
|
||||
blasphemous. When I was fighting to make this program work, I started
|
||||
wondering if it was not the reason for its very erratic behaviour.</p>
|
||||
|
||||
<h3>prog.c vs prog.orig.c</h3>
|
||||
|
||||
<p>The file <code>prog.orig.c</code> is the one I submitted.</p>
|
||||
|
||||
<p>Gil Dogon noted a few unsafe statements (statements whose behaviour is
|
||||
undefined in the C standard and, as such, could cause issues with other
|
||||
compilers or optimization levels). These have been fixed in <code>prog.c</code>.
|
||||
After this fix, in order to remain rule-2-compliant, a variable name has
|
||||
also been shortened in this file.</p>
|
||||
|
||||
<h3>How to build</h3>
|
||||
|
||||
<p>If you have <code>clang</code>:</p>
|
||||
|
||||
<pre><code>$ CC=clang make -e
|
||||
</code></pre>
|
||||
|
||||
<p>Otherwise (gcc):</p>
|
||||
|
||||
<pre><code>$ make
|
||||
</code></pre>
|
||||
|
||||
<p>(You will get a few warnings in this case.)</p>
|
||||
|
||||
<h3>How to use it</h3>
|
||||
|
||||
<p>You need a terminal configured to handle an <em>UTF-8</em> encoding and a
|
||||
font including <em>braille patterns</em>.
|
||||
This is the default on most modern GNU/Linux operating systems.
|
||||
The default terminal application (gnome-terminal) or even a simple
|
||||
xterm should render things properly.
|
||||
I tested this on several Debian and Ubuntu systems, 32 and 64bits (no configuration was needed).
|
||||
I also tested it on FreeBSD 9.3 32bits (font and encoding configuration
|
||||
was needed in this case).</p>
|
||||
|
||||
<p>Basic mode:</p>
|
||||
|
||||
<pre><code>$ echo 'I am testing this thing.' | ./prog
|
||||
[... rendering ...]
|
||||
|
||||
$ ./prog < lorem-ipsum.txt
|
||||
[... rendering ...]
|
||||
</code></pre>
|
||||
|
||||
<p>Interactive mode:</p>
|
||||
|
||||
<pre><code>$ ./prog
|
||||
> hello world!!!
|
||||
[... rendering ...]
|
||||
>
|
||||
</code></pre>
|
||||
|
||||
<h3>Obfuscation</h3>
|
||||
|
||||
<p>This entry is obfuscated in various ways:</p>
|
||||
|
||||
<ul>
|
||||
<li>The structure is hidden by avoiding loops, ‘if’ statements, ternary
|
||||
conditionals, and jump-related instructions. Instead, recursivity is
|
||||
heavily used.</li>
|
||||
<li>Merging all functions into one added even more recursivity. ;)</li>
|
||||
<li>The provided code does not contain the same number of opening and closing
|
||||
parenthesis.</li>
|
||||
<li>Preprocessing the code inflates it and adds lots of indents. Removing some
|
||||
of the tricks involved without breaking the program will be challenging.</li>
|
||||
<li>The program ‘plays’ with standard input & output streams, which causes
|
||||
unusual side effects.</li>
|
||||
<li>Some variables are re-used for unrelated processings.</li>
|
||||
<li>Crucial data may be hidden in unexpected places (e.g. as the size of
|
||||
a temporary buffer).</li>
|
||||
<li>Some parts of the code may have no effect (but may have an effect in a
|
||||
specific context, who knows?), and classical libc functions may not act
|
||||
as usual.</li>
|
||||
<li>And of course variable names are hard to read (or distracting).</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>On the other hand, the following may help:</p>
|
||||
|
||||
<ul>
|
||||
<li>The code layout should help to identify which part of the code is
|
||||
obfuscated. ;)</li>
|
||||
<li>File ‘codes.txt’ shows how each character is drawn. This data is
|
||||
encoded in macro O_o at the top of the source file.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Limitations</h3>
|
||||
|
||||
<h4>Charset</h4>
|
||||
|
||||
<p>In order to comply with the size rule, I encoded only a part of the visible ASCII
|
||||
chars:</p>
|
||||
|
||||
<pre><code>a-z, A-Z, '.' ':' ',' ';' '!' and '?'.
|
||||
</code></pre>
|
||||
|
||||
<p>Uppercase and lowercase chars are rendered the same.
|
||||
The program also understand the space and the linefeed (\n).
|
||||
Other chars are simply ignored (most of the time ;)</p>
|
||||
|
||||
<h4>Stack size</h4>
|
||||
|
||||
<p>This limitation is due to the heavy use of recursivity. After having processed
|
||||
a large number of characters, the process may exceed the stack size and crash.
|
||||
(However I did not experience this myself. The top-level recursion might be
|
||||
removed by the compiler as part of its optimizations.)</p>
|
||||
|
||||
<h4>Line rendering</h4>
|
||||
|
||||
<p>The program does its best to avoid cutting words at the end of lines, but
|
||||
it could still happen in case of long words.</p>
|
||||
|
||||
<h3>Subtleties and extra features</h3>
|
||||
|
||||
<h4>Handling more than text docs?</h4>
|
||||
|
||||
<p>Given the limited set of characters handled, the program is mostly limited
|
||||
to simple text documents.
|
||||
Thus, if you try for example:</p>
|
||||
|
||||
<pre><code>$ ./prog < prog.c
|
||||
</code></pre>
|
||||
|
||||
<p>You will not get something that looks like C code. (but you can still try,
|
||||
if you are curious. :)</p>
|
||||
|
||||
<h4>A ‘draft’ mode</h4>
|
||||
|
||||
<p>Defining an environment variable called DRAFT will enable the ‘draft-mode’.
|
||||
Try for example:</p>
|
||||
|
||||
<pre><code>$ echo 'testing the draft mode' | DRAFT=1 ./prog
|
||||
</code></pre>
|
||||
|
||||
<p>The program will run much faster but the rendering will be less precise.</p>
|
||||
|
||||
<h4>The subtle interactive mode</h4>
|
||||
|
||||
<p>I saved the best for last: usually, programs that handle an “interactive
|
||||
mode” have to check whether their standard input is a terminal or not (by
|
||||
using isatty()). Did you notice that this program does not perform any such
|
||||
detection, but still behaves (or seems to behave) appropriately?</p>
|
||||
|
||||
<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