add hack-a-round for language specified markdown code blocks
When language is specified in a markdown code block such as:
````
```c
printf("Hello, world!\n");
```
````
is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.
A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment. For example:
````
```<!---c-->
printf("Hello, world!\n");
```
````
This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better "_hack-a-round_" to the "markdown code language
specifier" problem is found.
The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:
```
<pre class="<!---c-->"><code> .. </code></pre>
```
We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.
For now, this hack-a-round will have to do.
This commit is contained in:
1 parent
3919df50fb
commit
b66c79254a
700 files changed
+7052
-7056
No files matched your search
+11
-11
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ version see the [original code](#original-code) section below.
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./birken.alt < 17_columns_wide_paint_by_numbers_file
|
||||
```
|
||||
|
||||
@@ -30,7 +30,7 @@ it should you wish (see below).
|
||||
|
||||
To see the program run on each text file, try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.alt.sh
|
||||
```
|
||||
|
||||
@@ -44,7 +44,7 @@ other entries where this was made an alternate version it is configurable at
|
||||
compile time. If you wish to speed it up by 100% you can instead do:
|
||||
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make clobber SLEEP=7500 alt
|
||||
```
|
||||
|
||||
@@ -55,7 +55,7 @@ If you wish to speed that up 200% (300% total) you can use instead try
|
||||
ctrl-c to terminate the program early but note that the terminal is likely to be
|
||||
messed up. In that case try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
reset
|
||||
```
|
||||
|
||||
@@ -70,7 +70,7 @@ hard to see the art of the entry but you may do so if you wish.
|
||||
|
||||
### Original build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make all
|
||||
```
|
||||
|
||||
@@ -84,7 +84,7 @@ Use `birken` as you would `birken.alt` above.
|
||||
|
||||
To use the demo script with the original code, try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -96,7 +96,7 @@ PLEASE be careful if you are sensitive to flashing colours!
|
||||
This program also wins the "Most amusing abuse of the iocccsize tool" award;
|
||||
although not the absolute best: it is possible to achieve 0 by writing:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
/* *\
|
||||
/....
|
||||
```
|
||||
@@ -319,7 +319,7 @@ This program demonstrates how to exploit a bug in IOCCC size tool version
|
||||
|
||||
If that line is added to the top of any program, the tool will report a size of 8.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
$ ./iocccsize -i < prog.c
|
||||
8
|
||||
```
|
||||
@@ -327,7 +327,7 @@ If that line is added to the top of any program, the tool will report a size of
|
||||
When that line is deleted from this program, the tool properly reports the
|
||||
secondary size limit of the program as 2048.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
$ ./iocccsize -i < birken.c
|
||||
2048
|
||||
```
|
||||
@@ -357,7 +357,7 @@ Carefully selected variable names also yielded wonderful expressions like `l=0`,
|
||||
`O=0`, `O=1` and `while(O)`. `"Tetris"` also makes a second appearance of
|
||||
sorts:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
[T][e][t]--; while(R+i) { s
|
||||
```
|
||||
|
||||
|
||||
+14
-14
@@ -141,12 +141,12 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<p>We recommend that you use the alt version first to see what this entry looked
|
||||
like back in 2013 (with a configurable speed). If you wish to use the original
|
||||
version see the <a href="#original-code">original code</a> section below.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<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">./birken.alt</span> <span class="op"><</span> 17_columns_wide_paint_by_numbers_file</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./birken.alt < 17_columns_wide_paint_by_numbers_file</code></pre>
|
||||
<p>NOTE: if your terminal is messed up after running this (perhaps from exiting
|
||||
before it finishes) try using <code>reset</code> to restore the terminal. This will clear
|
||||
the screen.</p>
|
||||
@@ -157,7 +157,7 @@ be problematic for some people, can be configured to different speeds by way of
|
||||
the value used in <code>usleep(3)</code>. The default is <code>13500</code> but you can reconfigure
|
||||
it should you wish (see below).</p>
|
||||
<p>To see the program run on each text file, try:</p>
|
||||
<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.alt.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.alt.sh</code></pre>
|
||||
<p>If you have perl installed it will also try a random run.</p>
|
||||
<p>Finding the ‘right’ default value was a fine line; the default, 15000
|
||||
microseconds (0.015 seconds), will take quite a while to finish but it allows
|
||||
@@ -165,30 +165,30 @@ one to more easily see what is going on. Even easier to see would be 25000 but
|
||||
these values make it quite slow and one could easily lose interest. Like some
|
||||
other entries where this was made an alternate version it is configurable at
|
||||
compile time. If you wish to speed it up by 100% you can instead do:</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> clobber SLEEP=7500 alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make clobber SLEEP=7500 alt</code></pre>
|
||||
<p>and then try <code>birken.alt</code> as above.</p>
|
||||
<p>If you wish to speed that up 200% (300% total) you can use instead try
|
||||
<code>SLEEP=3750</code>. Doing this you might find the right value to your liking; use
|
||||
ctrl-c to terminate the program early but note that the terminal is likely to be
|
||||
messed up. In that case try:</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">reset</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> reset</code></pre>
|
||||
<p>to make it sane again (running to completion will do that for you).</p>
|
||||
<h2 id="original-code">Original code:</h2>
|
||||
<p>The original code will run faster with modern systems which is likely to make it
|
||||
hard to see the art of the entry but you may do so if you wish.</p>
|
||||
<h3 id="original-build">Original build:</h3>
|
||||
<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">make</span> all</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make all</code></pre>
|
||||
<h3 id="original-use">Original use:</h3>
|
||||
<p>Use <code>birken</code> as you would <code>birken.alt</code> above.</p>
|
||||
<h3 id="original-try">Original try:</h3>
|
||||
<p>To use the demo script with the original code, try:</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="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>PLEASE be careful if you are sensitive to flashing colours!</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>This program also wins the “Most amusing abuse of the iocccsize tool” award;
|
||||
although not the absolute best: it is possible to achieve 0 by writing:</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> <span class="co">/* *\</span></span>
|
||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="co"> /....</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> /* *\
|
||||
/....</code></pre>
|
||||
<p>The game of Tetris had been used in many endeavors, from studying <a href="http://arxiv.org/abs/cs/0210020">algorithmic
|
||||
complexity</a> to <a href="http://www.livescience.com/19894-tetris-treat-ptsd-flashbacks.html">treating
|
||||
PTSD</a> and
|
||||
@@ -346,12 +346,12 @@ call to <code>fflush(3)</code> (N.B: see <a href="birken.alt.c">birken.alt.c</a>
|
||||
<code>2013-07-30-v17</code>. The first line of the program is reproduced below.</p>
|
||||
<p>char<em>_ = “’”“/</em>”;</p>
|
||||
<p>If that line is added to the top of any program, the tool will report a size of 8.</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ./iocccsize <span class="at">-i</span> <span class="op"><</span> prog.c</span>
|
||||
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">8</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> $ ./iocccsize -i < prog.c
|
||||
8</code></pre>
|
||||
<p>When that line is deleted from this program, the tool properly reports the
|
||||
secondary size limit of the program as 2048.</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ./iocccsize <span class="at">-i</span> <span class="op"><</span> birken.c</span>
|
||||
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">2048</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> $ ./iocccsize -i < birken.c
|
||||
2048</code></pre>
|
||||
<p>Although this bug provides an easy means of circumventing contest rule 2, as
|
||||
demonstrated from the size value, this entry is not necessarily striving for a
|
||||
‘worst abuse of the rules’ award.</p>
|
||||
@@ -371,7 +371,7 @@ Pajitnov</a>’s original 1984
|
||||
<p>Carefully selected variable names also yielded wonderful expressions like <code>l=0</code>,
|
||||
<code>O=0</code>, <code>O=1</code> and <code>while(O)</code>. <code>"Tetris"</code> also makes a second appearance of
|
||||
sorts:</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span>T<span class="op">][</span>e<span class="op">][</span>t<span class="op">]--;</span> <span class="cf">while</span><span class="op">(</span>R<span class="op">+</span>i<span class="op">)</span> <span class="op">{</span> s</span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> [T][e][t]--; while(R+i) { s</code></pre>
|
||||
<p>The source is formatted to resemble the
|
||||
<a href="https://en.wikipedia.org/wiki/Tetris">Tetris</a> play-field mid-game. It is also
|
||||
an homage to all the <a href="../../years.html">past IOCCC entries</a> formatted as a compact
|
||||
|
||||
Reference in new issue
Block a user