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,229 +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.2.0">
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=utf-8"> <link rel="stylesheet"
|
||||
type="text/css"
|
||||
href="../hint.css">
|
||||
<title>Most in need of transparency</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Most in need of transparency</h1>
|
||||
|
||||
<p>Don Yang<br>
|
||||
<a href="http://uguu.org/">http://uguu.org/</a></p>
|
||||
|
||||
<h2>Judges' comments:</h2>
|
||||
|
||||
<h3>To use:</h3>
|
||||
|
||||
<pre><code>make
|
||||
|
||||
./prog sample_input.txt a b c d
|
||||
|
||||
cat a
|
||||
|
||||
cat b
|
||||
|
||||
cat c
|
||||
|
||||
cat d
|
||||
|
||||
cat a b c d | ./prog
|
||||
</code></pre>
|
||||
|
||||
<h3>Try:</h3>
|
||||
|
||||
<pre><code>./prog prog.c a b c d e
|
||||
|
||||
cat a
|
||||
|
||||
cat b
|
||||
|
||||
cat c
|
||||
|
||||
cat d
|
||||
|
||||
cat e
|
||||
|
||||
cat a b c d e | ./prog
|
||||
|
||||
cat a b c d e | ./prog | diff - prog.c
|
||||
</code></pre>
|
||||
|
||||
<h3>Selected Judges Remarks:</h3>
|
||||
|
||||
<p>Do you understand how this program works?
|
||||
You may have to go over and over the output again.</p>
|
||||
|
||||
<h2>Author’s comments:</h2>
|
||||
|
||||
<h1>Summary</h1>
|
||||
|
||||
<p>Scramble/unscramble to single file:</p>
|
||||
|
||||
<pre><code>./prog original.txt > scrambled.txt
|
||||
|
||||
./prog < scrambled.txt > unscrambled.txt
|
||||
</code></pre>
|
||||
|
||||
<p>Scramble/unscramble to multiple files:</p>
|
||||
|
||||
<pre><code>./prog input.txt output1.txt output2.txt ...
|
||||
|
||||
cat output1.txt output2.txt ... | ./prog > unscrambled.txt
|
||||
</code></pre>
|
||||
|
||||
<p>Re-scramble:</p>
|
||||
|
||||
<pre><code>./prog original.txt | ./prog - > scrambled1.txt
|
||||
./prog original.txt | ./prog - | ./prog - > scrambled2.txt
|
||||
./prog original.txt | ./prog - | ./prog - | ... > scrambled3.txt
|
||||
</code></pre>
|
||||
|
||||
<p>Scramble slowly:</p>
|
||||
|
||||
<pre><code>./prog input.txt | ruby prog.c
|
||||
</code></pre>
|
||||
|
||||
<p>Input must be in UTF-8 encoding.</p>
|
||||
|
||||
<h1>Details</h1>
|
||||
|
||||
<p>This is a text scrambling utility. To scramble text, specify input
|
||||
file name as the first argument:</p>
|
||||
|
||||
<pre><code>./prog input.txt > output.txt
|
||||
</code></pre>
|
||||
|
||||
<p>If original input file was small enough to fit in your terminal, you
|
||||
can simply use <code>cat</code> to unscramble the output text.</p>
|
||||
|
||||
<pre><code>cat output.txt
|
||||
</code></pre>
|
||||
|
||||
<p>It might seem like nothing was scrambled, but you can try passing the
|
||||
output through <code>strings(1)</code> and see that most of the original strings
|
||||
are gone. What happened is that the original text has been shuffled
|
||||
with ANSI cursor positioning codes inserted such that characters are
|
||||
printed in random order. This effect is more visible if there is a
|
||||
delay after each character is printed. For convenience, an utility is
|
||||
included in the source to output characters slowly:</p>
|
||||
|
||||
<pre><code>./prog input.txt | ruby prog.c
|
||||
</code></pre>
|
||||
|
||||
<p>Scrambling order is deterministic, but you can reshuffle the output by
|
||||
piping it through the same utility again, by specifying <code>-</code> as the
|
||||
first argument:</p>
|
||||
|
||||
<pre><code>./prog input.txt | ./prog - | ./prog - | ...
|
||||
</code></pre>
|
||||
|
||||
<p>You can also split the input to multiple files, each getting a subset
|
||||
of the original input characters:</p>
|
||||
|
||||
<pre><code>./prog input.txt output1.txt output2.txt ...
|
||||
cat output1.txt output2.txt ... > unscrambled.txt
|
||||
</code></pre>
|
||||
|
||||
<p>You can only unscramble files with <code>cat</code> if the input fits in a single
|
||||
terminal screen. If you don’t know what will be the terminal size of
|
||||
the recipient, note that <code>prog.c</code> will fit in a 80x25 terminal, so a
|
||||
good guideline is to pick files that have fewer rows and columns than
|
||||
<code>prog.c</code>.</p>
|
||||
|
||||
<p>For files that are larger than your terminal window, <code>cat</code> will not be
|
||||
sufficient for unscrambling because any scrolling causes the character
|
||||
positions to be misaligned. But fear not, this utility also includes
|
||||
unscrambling functionality. If no argument is specified, input will
|
||||
be read through stdin and unscrambled to stdout:</p>
|
||||
|
||||
<pre><code>./prog < scrambled.txt > unscrambled.txt
|
||||
</code></pre>
|
||||
|
||||
<p>Where this is useful is that if you scramble the input to multiple
|
||||
files and unscramble each output files individually, those output
|
||||
files can be printed on transparencies and distributed separately.</p>
|
||||
|
||||
<pre><code>./prog input.txt output1.txt output2.txt output3.txt
|
||||
./prog < output1.txt > layer1.txt
|
||||
./prog < output2.txt > layer2.txt
|
||||
./prog < output3.txt > layer3.txt
|
||||
</code></pre>
|
||||
|
||||
<p>In other words, this is a utility for facilitating
|
||||
<a href="https://en.wikipedia.org/wiki/Visual_cryptography">visual cryptography</a>.</p>
|
||||
|
||||
<p>This utility can also be used just for removing trailing whitespaces
|
||||
and expanding tabs to 8 spaces.</p>
|
||||
|
||||
<pre><code>./prog input.txt | ./prog
|
||||
</code></pre>
|
||||
|
||||
<h1>Features</h1>
|
||||
|
||||
<h2>UTF-8 support</h2>
|
||||
|
||||
<p>A simple text scrambling utility might not have required a screenful
|
||||
of code, but this particular one natively supports UTF-8.
|
||||
Specifically: individual UTF-8 byte sequences will not be split into
|
||||
broken ones, and the utility is aware of full-width versus half-width
|
||||
differences such that cursor is positioned correctly for most CJK
|
||||
input. <code>sample_input.txt</code> demonstrates this feature with a mix of
|
||||
Basic Latin and Japanese characters.</p>
|
||||
|
||||
<p>Output cursor positions will most definitely be wrong for inputs
|
||||
containing combining characters and right-to-left text, but it should
|
||||
be possible to unscramble those text back to the original using this
|
||||
same utility, since the utility is self-consistent in how cursor
|
||||
positions are handled.</p>
|
||||
|
||||
<h2>Error handling</h2>
|
||||
|
||||
<p>If any file can not be opened for reading or writing, an error is
|
||||
printed to stderr, and the utility will exit with nonzero status.</p>
|
||||
|
||||
<p>If there isn’t enough memory, the utility will likely crash.</p>
|
||||
|
||||
<p>If input contains CR-LF end of line sequences, those CRs are silently
|
||||
dropped. In fact, most control codes are silently ignored except line
|
||||
feeds (preserved) and tabs (expanded to 8 spaces).</p>
|
||||
|
||||
<h2>Compatibility</h2>
|
||||
|
||||
<p>Verified to work and compiles without warnings on these environments:</p>
|
||||
|
||||
<ul>
|
||||
<li> gcc 7.3.0 on Linux</li>
|
||||
<li> gcc 7.4.0 on Cygwin</li>
|
||||
<li> clang 4.0.1-10 on Linux</li>
|
||||
<li> clang 5.0.1 on Cygwin</li>
|
||||
<li> gcc 4.8.4 on Linux</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Full version</h2>
|
||||
|
||||
<p>I tried really hard to make <code>prog.c</code> fit in a 80x25 terminal without
|
||||
wrapping. If I were not constrained by space, I would have made an
|
||||
ASCII art out of it. <code>violet.c</code> is that program, and also comes with
|
||||
the minor benefit of supporting lines longer than a million columns
|
||||
depending on <code>sizeof(int)</code>.</p>
|
||||
|
||||
<p>Violet is named after “Violet Evergarden”, the character who is highly
|
||||
skilled in writing letters.</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<TABLE><TR>
|
||||
<TD><a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="/png/by-sa-3.0-88x31.png" /></a></TD>
|
||||
<TD><P>© Copyright 1984-2019,
|
||||
<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="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
|
||||
<TD> <!--<a href="https://validator.w3.org/check?uri=referer"><img src="https://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