processed John Dalbec's fix of 2000/dlowe

Updated `bugs.html` to reflect the fix of all known bugs in `2000/dlowe`.

Added thank you to John Dalbec in `thanks-for-help.md`.

Added processing of "%%REPO_TOP_URL%%" tokens to `bin/subst.default.sh`.

Updated `find-missing-links.sh` to not falsely report missing links
when a "%%REPO_TOP_URL%%" token is used.

Changed `bin/subst.default.sh` VERSION from "1.3.2 2024-08-05"
to "1.4.0 2025-04-16".

Changed `bin/find-missing-links.sh` VERSION from "1.1.1 2024-04-28"
to "1.2.0 2025-04-16".

Due to a `pandoc(1)` bug fix, `2011/fredriksson/index.html` and
`2012/kang/index.html` were modified.  The bug fix removed extraneous
whitespace that was previously introduced into HTML under certain
situations.  These 2 changes do **NOT** impact the way web browsers
render these pages, however.

Updated sitemap.

Tested the above via `make www gen_status gen_sitemap timestamp` on macOS.
This commit is contained in:
Landon Curt Noll committed 2025-04-16 13:30:55 -07:00
1 parent d644602053
commit 54fdd0f39c
11 files changed
+478 -834

No files matched your search

-1
View File
@@ -17,7 +17,6 @@ The following bit of perl may help determine the values you need:
The current status of this entry is:
> **STATUS: known bug - please help us fix**<br>
> **STATUS: INABIAF - please DO NOT fix**
For more detailed information see [2000/dlowe in bugs.html](../../bugs.html#2000_dlowe).
+1 -2
View File
@@ -452,8 +452,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<blockquote>
<p><strong>STATUS: known bug - please help us fix</strong><br>
<strong>STATUS: INABIAF - please DO NOT fix</strong></p>
<p><strong>STATUS: INABIAF - please DO NOT fix</strong></p>
</blockquote>
<p>For more detailed information see <a href="../../bugs.html#2000_dlowe">2000/dlowe in bugs.html</a>.</p>
<h2 id="to-use">To use:</h2>
+10 -34
View File
@@ -102,28 +102,9 @@ shopt -u nocaseglob # disable strict case matching
shopt -u extglob # enable extended globbing patterns
shopt -s globstar # enable ** to match all files and zero or more directories and subdirectories
# IOCCC requires use of C locale
#
export LANG="C"
export LC_CTYPE="C"
export LC_NUMERIC="C"
export LC_TIME="C"
export LC_COLLATE="C"
export LC_MONETARY="C"
export LC_MESSAGES="C"
export LC_PAPER="C"
export LC_NAME="C"
export LC_ADDRESS="C"
export LC_TELEPHONE="C"
export LC_MEASUREMENT="C"
export LC_IDENTIFICATION="C"
export LC_ALL="C"
# set variables referenced in the usage message
#
export VERSION="2.0.0 2025-03-13"
export VERSION="1.2.0 2025-04-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -284,20 +265,6 @@ fi
# If -v 3 or higher, print exported variables in order that they were exported.
#
if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: LANG=$LANG" 1>&2
echo "$0: debug[3]: LC_CTYPE=$LC_CTYPE" 1>&2
echo "$0: debug[3]: LC_NUMERIC=$LC_NUMERIC" 1>&2
echo "$0: debug[3]: LC_TIME=$LC_TIME" 1>&2
echo "$0: debug[3]: LC_COLLATE=$LC_COLLATE" 1>&2
echo "$0: debug[3]: LC_MONETARY=$LC_MONETARY" 1>&2
echo "$0: debug[3]: LC_MESSAGES=$LC_MESSAGES" 1>&2
echo "$0: debug[3]: LC_PAPER=$LC_PAPER" 1>&2
echo "$0: debug[3]: LC_NAME=$LC_NAME" 1>&2
echo "$0: debug[3]: LC_ADDRESS=$LC_ADDRESS" 1>&2
echo "$0: debug[3]: LC_TELEPHONE=$LC_TELEPHONE" 1>&2
echo "$0: debug[3]: LC_MEASUREMENT=$LC_MEASUREMENT" 1>&2
echo "$0: debug[3]: LC_IDENTIFICATION=$LC_IDENTIFICATION" 1>&2
echo "$0: debug[3]: LC_ALL=$LC_ALL" 1>&2
echo "$0: debug[3]: VERSION=$VERSION" 1>&2
echo "$0: debug[3]: NAME=$NAME" 1>&2
echo "$0: debug[3]: V_FLAG=$V_FLAG" 1>&2
@@ -461,6 +428,14 @@ fi
#
# -e "s;%%REPO_URL%%/*;$TOPDIR/;" \
#
# # delete all lines containing %%REPO_TOP_URL%%
#
# We cannot check as local files, URLs that generally under GitHub
# However paths under REPO_URL=$REPO_TOP_URL/blob/master DO map to $TOPDIR,
# so we only convert %%REPO_URL%% to $TOPDIR, but NOT %%REPO_TOP_URL%%.
#
# -e '/%%REPO_TOP_URL%%/d' \
#
# # convert "%%DOCROOT_SLASH%%" into TOPDIR
#
# -e "s;%%DOCROOT_SLASH%%/*;$TOPDIR/;" \
@@ -519,6 +494,7 @@ find . -name '*.md' ! -name markdown.md ! -path './tmp/*' ! -path './NOTES/*' -p
-e '/^https?:/d' \
-e '/^mailto:/d' \
-e "s;%%REPO_URL%%/*;$TOPDIR/;" \
-e '/%%REPO_TOP_URL%%/d' \
-e "s;%%DOCROOT_SLASH%%/*;$TOPDIR/;" \
-e "s;^([^/]);$TOPDIR/$MD_DIR/\1;" \
-e '/%%TOKEN%%/d' \
+7 -33
View File
@@ -93,27 +93,9 @@ shopt -u extglob # enable extended globbing patterns
shopt -s globstar # enable ** to match all files and zero or more directories and subdirectories
# IOCCC requires use of C locale
#
export LANG="C"
export LC_CTYPE="C"
export LC_NUMERIC="C"
export LC_TIME="C"
export LC_COLLATE="C"
export LC_MONETARY="C"
export LC_MESSAGES="C"
export LC_PAPER="C"
export LC_NAME="C"
export LC_ADDRESS="C"
export LC_TELEPHONE="C"
export LC_MEASUREMENT="C"
export LC_IDENTIFICATION="C"
export LC_ALL="C"
# set variables referenced in the usage message
#
export VERSION="2.0.0 2025-03-13"
export VERSION="1.4.0 2025-04-16"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -257,20 +239,6 @@ export VALIDATOR_ENCODED_URL
# parameter debugging
#
if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: LANG=$LANG" 1>&2
echo "$0: debug[3]: LC_CTYPE=$LC_CTYPE" 1>&2
echo "$0: debug[3]: LC_NUMERIC=$LC_NUMERIC" 1>&2
echo "$0: debug[3]: LC_TIME=$LC_TIME" 1>&2
echo "$0: debug[3]: LC_COLLATE=$LC_COLLATE" 1>&2
echo "$0: debug[3]: LC_MONETARY=$LC_MONETARY" 1>&2
echo "$0: debug[3]: LC_MESSAGES=$LC_MESSAGES" 1>&2
echo "$0: debug[3]: LC_PAPER=$LC_PAPER" 1>&2
echo "$0: debug[3]: LC_NAME=$LC_NAME" 1>&2
echo "$0: debug[3]: LC_ADDRESS=$LC_ADDRESS" 1>&2
echo "$0: debug[3]: LC_TELEPHONE=$LC_TELEPHONE" 1>&2
echo "$0: debug[3]: LC_MEASUREMENT=$LC_MEASUREMENT" 1>&2
echo "$0: debug[3]: LC_IDENTIFICATION=$LC_IDENTIFICATION" 1>&2
echo "$0: debug[3]: LC_ALL=$LC_ALL" 1>&2
echo "$0: debug[3]: VERSION=$VERSION" 1>&2
echo "$0: debug[3]: NAME=$NAME" 1>&2
echo "$0: debug[3]: V_FLAG=$V_FLAG" 1>&2
@@ -303,6 +271,12 @@ echo "-s"
echo "HEADER_1=The International Obfuscated C Code Contest"
# output REPO_TOP_URL substitution
#
echo "-s"
echo "REPO_TOP_URL=$REPO_TOP_URL"
# output REPO_URL substitution
#
echo "-s"
+5 -135
View File
@@ -1874,136 +1874,6 @@ is in the index.html file as something to try and ponder.</p>
<h2 id="dlowe-1">2000/dlowe</h2>
</div>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-known-bug---please-help-us-fix-6">STATUS: known bug - please help us fix</h3>
<h3 id="source-code-2000dlowedlowe.c">Source code: <a href="https://github.com/ioccc-src/winner/blob/master/2000/dlowe/dlowe.c">2000/dlowe/dlowe.c</a></h3>
<h3 id="information-2000dloweindex.html">Information: <a href="2000/dlowe/index.html">2000/dlowe/index.html</a></h3>
<p>The author gives an example command:</p>
<pre><code> echo &quot;7 P 6 d P P 8 p&quot; | ./dlowe | tr 876 tpo</code></pre>
<p>which should print out <code>poot</code> but it doesn’t, not in linux and not in macOS.</p>
<p>In linux it doesn’t crash but it doesn’t print anything out either.</p>
<p>In macOS it crashes; it might appear to not crash in macOS but this is because
of the pipeline. If you remove the <code>| tr 876 tpo</code> part of the command you will
see that it does indeed crash!</p>
<p>The reason for this not working is really strange.</p>
<pre><code> $ echo &quot;7 P 6 d P P 8 p&quot; | ./dlowe
7668
$ echo &quot;7 P 6 d P P 8 p&quot; | ./dlowe | grep 7
$</code></pre>
<p>Why? Is it writing to stdout? Let’s try some other things:</p>
<pre><code> $ echo 7668 | tr 876 tpo
poot</code></pre>
<p>Okay so we know that it SHOULD work. But we also know something funny is going on with stdout and the entry. Another experiment:</p>
<pre><code> $ echo &quot;7 P 6 d P P 8 p&quot; | ./dlowe 1&gt;&amp;2 | grep 7
7668</code></pre>
<p>Okay so now it sees it, <code>grep</code>. But watch!</p>
<pre><code> $ echo &quot;7 P 6 d P P 8 p&quot; | ./dlowe 2&gt;foo 1&gt;&amp;1
7668
$ cat foo</code></pre>
<p>.. so it does appear to be writing to stdout but yet somehow it doesn’t? But watch:</p>
<pre><code> $ echo &quot;7 P 6 d P P 8 p&quot; | ./dlowe 1&gt;foo 1&gt;&amp;1
$ cat foo
$</code></pre>
<p>Well this explains why the <code>tr</code> does not transliterate it to <code>poot</code> but why is
this happening? Why can’t it be redirected to another file even?</p>
<p>If it could be figured out why it’s not writing to stdout and yet at the same
time is writing to stdout one bug could be fixed. Maybe it’s the perl messing
with things but we don’t know.</p>
<p>Other commands do work, however, and give the appropriate output, such as:</p>
<pre><code> $ echo 1 2 + p | ./dlowe
3</code></pre>
<p>so something is wrong with some commands/operators.</p>
<p>Another feature that does work in linux is:</p>
<pre><code> $ echo poot | ./dlowe
poot was here!</code></pre>
<p>Can you help fix these problems?</p>
<p>Here is some C code that creates an unformatted perl script that will just
print ‘unimplemented’ for operators but it seems to work in some other ways (see
below for how to go further than unimplemented) which is the exact perl from the
C program except that it has the <code>#!/usr/bin/env perl</code> and <code>use warnings;</code> as
well. A note below might suggest that doing this creates incomplete perl.
Anyway:</p>
<pre><code> #include &lt;stdio.h&gt;
int main(void)
{
printf(&quot;#!/usr/bin/env perl\nuse warnings;_:$_= &lt;&gt; ; defined or exit; @ARGV&quot;
&quot;=split; __:$_= shift;defined or goto _; chomp &quot;
&quot;;(m*^\\x70oO&quot; &quot;\\x74$*i)?(pri&quot; &quot;nt \&quot;$_ w\\x&quot;
&quot;61s h\\145r\\x&quot; &quot;65!\\n\&quot;):((m*&quot; &quot;^\\s\\*(-?\\d+&quot;
&quot;(\\.\\d+)?)\\s&quot; &quot;\\*$*)?(push@SS ,$1):(&amp;{chr(((o&quot;
&quot;rd)%%39)+3**4)x2 } )); goto __; sub ff { @SS= (&quot;
&quot;)} sub __{print \&quot;stack empty\\&quot; &quot;n\&quot;} sub ss{$#&quot;
&quot;SS&lt;0 and goto &amp; __; print $SS[$&quot; &quot;#SS].\&quot;\\n\&quot;} &quot;
&quot;sub SS{ $#SS&lt;0 and goto &amp;__ ; print pop @SS}&quot;
&quot;sub _ { print \&quot;divide by zer&quot; &quot;o\\n\&quot;}sub ii{&quot;
&quot;map{ print\&quot;$_&quot; &quot;\\n\&quot; } reverse @SS} sub AUTOLO&quot;
&quot;AD { print\&quot;un&quot; &quot;implemented\\n&quot; &quot;\&quot;} sub gg{ $#&quot;
&quot;SS&lt;0 and goto &amp;__;push@SS,$SS[ $#SS]} sub uu{ &quot;
&quot;$#SS&lt;1 and goto &amp;__;$SS[ $#SS]+= $SS[$#SS-1];$SS&quot;
&quot;[$#SS-1]=$SS[$&quot; &quot;#SS]-$SS[$#SS-&quot; &quot;1]; $SS[$#SS]-&quot;
&quot;=$SS[$#SS-1]}&quot;);
}</code></pre>
<p>Compiling this you can generate:</p>
<pre><code> #!/usr/bin/env perl
use warnings;_:$_= &lt;&gt; ; defined or exit; @ARGV=split; __:$_= shift;defined or goto _; chomp ;(m*^\x70oO\x74$*i)?(print &quot;$_ w\x61s h\145r\x65!\n&quot;):((m*^\s\*(-?\d+(\.\d+)?)\s\*$*)?(push@SS ,$1):(&amp;{chr(((ord)%39)+3**4)x2 } )); goto __; sub ff { @SS= ()} sub __{print &quot;stack empty\n&quot;} sub ss{$#SS&lt;0 and goto &amp; __; print $SS[$#SS].&quot;\n&quot;} sub SS{ $#SS&lt;0 and goto &amp;__ ; print pop @SS}sub _ { print &quot;divide by zero\n&quot;}sub ii{map{ print&quot;$_\n&quot; } reverse @SS} sub AUTOLOAD { print&quot;unimplemented\n&quot;} sub gg{ $#SS&lt;0 and goto &amp;__;push@SS,$SS[ $#SS]} sub uu{ $#SS&lt;1 and goto &amp;__;$SS[ $#SS]+= $SS[$#SS-1];$SS[$#SS-1]=$SS[$#SS]-$SS[$#SS-1]; $SS[$#SS]-=$SS[$#SS-1]}</code></pre>
<p>Here is example input/output:</p>
<pre><code> p
stack empty
5 p
5
5 + 5 p
unimplemented
5
P
5
p
5</code></pre>
<p>So you can see that if one uses operators it just shows ‘unimplemented’ (observe
how this does not happen in the C program in linux!) but if one uses ‘p’ by
itself it will print what’s on the stack (for example).</p>
<p>To not get ‘unimplemented’ you can remove from the perl:</p>
<pre><code> sub AUTOLOAD { print&quot;unimplemented\n&quot;}</code></pre>
<p>(Note that the author stated this was used for exception handling so another
possibility is that the C code doesn’t generate the correct perl and indeed even
spaces is known to break the perl in at least one way, syntax errors, but maybe
others too.)</p>
<p>Here is an example run of several operations in the perl script after removing
that subroutine:</p>
<pre><code> $ echo 5 5 p | ./dlowe.pl
5
$ echo 5 5 + p | ./dlowe.pl
5
Undefined subroutine &amp;main::UU called at ./pl.pl line 2, &lt;&gt; line 1.
$ echo 5 5 * p | ./dlowe.pl
5
Undefined subroutine &amp;main::ww called at ./pl.pl line 2, &lt;&gt; line 1.
$ echo 5 5 - p | ./dlowe.pl
5
Undefined subroutine &amp;main::WW called at ./pl.pl line 2, &lt;&gt; line 1.
$ echo 5 5 / p | ./dlowe.pl
5
Undefined subroutine &amp;main::YY called at ./pl.pl line 2, &lt;&gt; line 1.
$ echo 5 P | ./dlowe.pl
5$ echo p | ./dlowe.pl
stack empty
$ echo P | ./dlowe.pl
stack empty</code></pre>
<p>Note the undefined subroutine error: that happens with commands that are not
even in the program. Again the author used <code>AUTOLOAD</code> for exception handling so
it seems likely that there is something missing (which the below shows as well).
For instance inputting <code>D</code> followed by <code>XX</code>:</p>
<pre><code> Undefined subroutine &amp;main::nn called at ./pl.pl line 2, &lt;&gt; line 6.
Undefined subroutine &amp;main::[[ called at ./pl.pl line 2, &lt;&gt; line 1.</code></pre>
<p>That means then that in linux despite the subroutines seemingly not existing it
works in the code, at least in some cases.</p>
<p>As far as the unimplemented error goes: the author stated that it means there is
invalid input. But as can be seen by the input given, the input is not
actually incorrect. It is also curious to note that it ends up printing what’s
on the stack at that point:</p>
<pre><code> $ echo 5 5 + p | ./dlowe.pl
unimplemented
5</code></pre>
<p>which might (?) suggest that the <code>+</code> operator is unimplemented.</p>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-inabiaf---please-do-not-fix-32">STATUS: INABIAF - please <strong>DO NOT</strong> fix</h3>
<p>The author states that in perl &lt; 5.6.0 there is a bug with a core dump in what
they said is in <code>Perl_sv_upgrade</code>. As this is documented it is not considered a
@@ -2166,7 +2036,7 @@ fixes there.</p>
<h2 id="herrmann1">2001/herrmann1</h2>
</div>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-known-bug---please-help-us-fix-7">STATUS: known bug - please help us fix</h3>
<h3 id="status-known-bug---please-help-us-fix-6">STATUS: known bug - please help us fix</h3>
<p>During compilation you’re supposed to see some animation but this does not seem
to work with modern gcc versions. It appears that version 2.95 works but maybe
others do as well. If you have a fix for modern versions of gcc, your help is
@@ -2249,7 +2119,7 @@ nobody else takes up the challenge.</p>
<h2 id="williams">2001/williams</h2>
</div>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-known-bug---please-help-us-fix-8">STATUS: known bug - please help us fix</h3>
<h3 id="status-known-bug---please-help-us-fix-7">STATUS: known bug - please help us fix</h3>
<h3 id="source-code-2001williamswilliams.c">Source code: <a href="https://github.com/ioccc-src/winner/blob/master/2001/williams/williams.c">2001/williams/williams.c</a></h3>
<h3 id="information-2001williamsindex.html">Information: <a href="2001/williams/index.html">2001/williams/index.html</a></h3>
<p>There seem to be a couple bugs at least in this entry. The first one is that
@@ -3196,7 +3066,7 @@ player become bigger, stay away from blocks!</p>
<h2 id="vik-2">2014/vik</h2>
</div>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-known-bug---please-help-us-fix-9">STATUS: known bug - please help us fix</h3>
<h3 id="status-known-bug---please-help-us-fix-8">STATUS: known bug - please help us fix</h3>
<h3 id="source-code-2014vikprog.c">Source code: <a href="https://github.com/ioccc-src/winner/blob/master/2014/vik/prog.c">2014/vik/prog.c</a></h3>
<h3 id="information-2014vikindex.html">Information: <a href="2014/vik/index.html">2014/vik/index.html</a></h3>
<p><a href="authors.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a> discovered a bug to do
@@ -3266,7 +3136,7 @@ result. Error messages become garbled, though.</p>
<h2 id="howe">2015/howe</h2>
</div>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-known-bug---please-help-us-fix-10">STATUS: known bug - please help us fix</h3>
<h3 id="status-known-bug---please-help-us-fix-9">STATUS: known bug - please help us fix</h3>
<p>The test scripts do not seem to work properly with bash but this would be ideal
as not all systems have a compatible shell (they assume a POSIX compliant
shell). One, with bash, might see:</p>
@@ -3374,7 +3244,7 @@ fixing the syntax error in the generated <code>ioccc.json</code> file.</p>
<h2 id="mills-1">2018/mills</h2>
</div>
<p>Jump to: <a href="#">top</a></p>
<h3 id="status-known-bug---please-help-us-fix-11">STATUS: known bug - please help us fix</h3>
<h3 id="status-known-bug---please-help-us-fix-10">STATUS: known bug - please help us fix</h3>
<h3 id="source-code-2018millsprog.c">Source code: <a href="https://github.com/ioccc-src/winner/blob/master/2018/mills/prog.c">2018/mills/prog.c</a></h3>
<h3 id="information-2018millsindex.html">Information: <a href="2018/mills/index.html">2018/mills/index.html</a></h3>
<p>After exiting the program (with ctrl-e) if you try running it again you will
-206
View File
@@ -2066,212 +2066,6 @@ Jump to: [top](#)
Jump to: [top](#)
### STATUS: known bug - please help us fix
### Source code: [2000/dlowe/dlowe.c](%%REPO_URL%%/2000/dlowe/dlowe.c)
### Information: [2000/dlowe/index.html](2000/dlowe/index.html)
The author gives an example command:
``` <!---sh-->
echo "7 P 6 d P P 8 p" | ./dlowe | tr 876 tpo
```
which should print out `poot` but it doesn't, not in linux and not in macOS.
In linux it doesn't crash but it doesn't print anything out either.
In macOS it crashes; it might appear to not crash in macOS but this is because
of the pipeline. If you remove the `| tr 876 tpo` part of the command you will
see that it does indeed crash!
The reason for this not working is really strange.
``` <!---sh-->
$ echo "7 P 6 d P P 8 p" | ./dlowe
7668
$ echo "7 P 6 d P P 8 p" | ./dlowe | grep 7
$
```
Why? Is it writing to stdout? Let's try some other things:
``` <!---sh-->
$ echo 7668 | tr 876 tpo
poot
```
Okay so we know that it SHOULD work. But we also know something funny is going on with stdout and the entry. Another experiment:
``` <!---sh-->
$ echo "7 P 6 d P P 8 p" | ./dlowe 1>&2 | grep 7
7668
```
Okay so now it sees it, `grep`. But watch!
``` <!---sh-->
$ echo "7 P 6 d P P 8 p" | ./dlowe 2>foo 1>&1
7668
$ cat foo
```
.. so it does appear to be writing to stdout but yet somehow it doesn't? But watch:
``` <!---sh-->
$ echo "7 P 6 d P P 8 p" | ./dlowe 1>foo 1>&1
$ cat foo
$
```
Well this explains why the `tr` does not transliterate it to `poot` but why is
this happening? Why can't it be redirected to another file even?
If it could be figured out why it's not writing to stdout and yet at the same
time is writing to stdout one bug could be fixed. Maybe it's the perl messing
with things but we don't know.
Other commands do work, however, and give the appropriate output, such as:
``` <!---sh-->
$ echo 1 2 + p | ./dlowe
3
```
so something is wrong with some commands/operators.
Another feature that does work in linux is:
``` <!---sh-->
$ echo poot | ./dlowe
poot was here!
```
Can you help fix these problems?
Here is some C code that creates an unformatted perl script that will just
print 'unimplemented' for operators but it seems to work in some other ways (see
below for how to go further than unimplemented) which is the exact perl from the
C program except that it has the `#!/usr/bin/env perl` and `use warnings;` as
well. A note below might suggest that doing this creates incomplete perl.
Anyway:
``` <!---c-->
#include <stdio.h>
int main(void)
{
printf("#!/usr/bin/env perl\nuse warnings;_:$_= <> ; defined or exit; @ARGV"
"=split; __:$_= shift;defined or goto _; chomp "
";(m*^\\x70oO" "\\x74$*i)?(pri" "nt \"$_ w\\x"
"61s h\\145r\\x" "65!\\n\"):((m*" "^\\s\\*(-?\\d+"
"(\\.\\d+)?)\\s" "\\*$*)?(push@SS ,$1):(&{chr(((o"
"rd)%%39)+3**4)x2 } )); goto __; sub ff { @SS= ("
")} sub __{print \"stack empty\\" "n\"} sub ss{$#"
"SS<0 and goto & __; print $SS[$" "#SS].\"\\n\"} "
"sub SS{ $#SS<0 and goto &__ ; print pop @SS}"
"sub _ { print \"divide by zer" "o\\n\"}sub ii{"
"map{ print\"$_" "\\n\" } reverse @SS} sub AUTOLO"
"AD { print\"un" "implemented\\n" "\"} sub gg{ $#"
"SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ "
"$#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS"
"[$#SS-1]=$SS[$" "#SS]-$SS[$#SS-" "1]; $SS[$#SS]-"
"=$SS[$#SS-1]}");
}
```
Compiling this you can generate:
``` <!---perl-->
#!/usr/bin/env perl
use warnings;_:$_= <> ; defined or exit; @ARGV=split; __:$_= shift;defined or goto _; chomp ;(m*^\x70oO\x74$*i)?(print "$_ w\x61s h\145r\x65!\n"):((m*^\s\*(-?\d+(\.\d+)?)\s\*$*)?(push@SS ,$1):(&{chr(((ord)%39)+3**4)x2 } )); goto __; sub ff { @SS= ()} sub __{print "stack empty\n"} sub ss{$#SS<0 and goto & __; print $SS[$#SS]."\n"} sub SS{ $#SS<0 and goto &__ ; print pop @SS}sub _ { print "divide by zero\n"}sub ii{map{ print"$_\n" } reverse @SS} sub AUTOLOAD { print"unimplemented\n"} sub gg{ $#SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ $#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS[$#SS-1]=$SS[$#SS]-$SS[$#SS-1]; $SS[$#SS]-=$SS[$#SS-1]}
```
Here is example input/output:
```
p
stack empty
5 p
5
5 + 5 p
unimplemented
5
P
5
p
5
```
So you can see that if one uses operators it just shows 'unimplemented' (observe
how this does not happen in the C program in linux!) but if one uses 'p' by
itself it will print what's on the stack (for example).
To not get 'unimplemented' you can remove from the perl:
``` <!---perl-->
sub AUTOLOAD { print"unimplemented\n"}
```
(Note that the author stated this was used for exception handling so another
possibility is that the C code doesn't generate the correct perl and indeed even
spaces is known to break the perl in at least one way, syntax errors, but maybe
others too.)
Here is an example run of several operations in the perl script after removing
that subroutine:
``` <!---sh-->
$ echo 5 5 p | ./dlowe.pl
5
$ echo 5 5 + p | ./dlowe.pl
5
Undefined subroutine &main::UU called at ./pl.pl line 2, <> line 1.
$ echo 5 5 * p | ./dlowe.pl
5
Undefined subroutine &main::ww called at ./pl.pl line 2, <> line 1.
$ echo 5 5 - p | ./dlowe.pl
5
Undefined subroutine &main::WW called at ./pl.pl line 2, <> line 1.
$ echo 5 5 / p | ./dlowe.pl
5
Undefined subroutine &main::YY called at ./pl.pl line 2, <> line 1.
$ echo 5 P | ./dlowe.pl
5$ echo p | ./dlowe.pl
stack empty
$ echo P | ./dlowe.pl
stack empty
```
Note the undefined subroutine error: that happens with commands that are not
even in the program. Again the author used `AUTOLOAD` for exception handling so
it seems likely that there is something missing (which the below shows as well).
For instance inputting `D` followed by `XX`:
```
Undefined subroutine &main::nn called at ./pl.pl line 2, <> line 6.
Undefined subroutine &main::[[ called at ./pl.pl line 2, <> line 1.
```
That means then that in linux despite the subroutines seemingly not existing it
works in the code, at least in some cases.
As far as the unimplemented error goes: the author stated that it means there is
invalid input. But as can be seen by the input given, the input is not
actually incorrect. It is also curious to note that it ends up printing what's
on the stack at that point:
``` <!---sh-->
$ echo 5 5 + p | ./dlowe.pl
unimplemented
5
```
which might (?) suggest that the `+` operator is unimplemented.
Jump to: [top](#)
### STATUS: INABIAF - please **DO NOT** fix
The author states that in perl < 5.6.0 there is a bug with a core dump in what
+413 -413
View File
File diff suppressed because it is too large. Load diff
+8 -7
View File
@@ -425,17 +425,18 @@
<!-- START: this line starts content generated by: bin/status2html.sh -->
<h1 id="the-ioccc-is-open-for-submissions">The IOCCC is open for submissions</h1>
<p>See the <a href="news.html">IOCCC news</a> page for possible updates to rules, guidelines, tools and deadlines.</p>
<p>See <a href="quick-start.html#enter">How to enter the IOCCC</a> FAQ for additional information.</p>
<p><strong>IMPORTANT</strong>: If you viewed the preliminary IOCCC rules, guidelines, and tools while the IOCCC status was pending, be sure to review the official IOCCC rules, guidelines, and tools for any changes that may have been recently made before submitting to the IOCCC.</p>
<h1 id="the-ioccc-is-pending">The IOCCC is pending</h1>
<p>While the IOCCC is not open now, there is a tentative opening date for the next IOCCC.</p>
<p>See the <a href="news.html">IOCCC news</a> for details including the tentative scheduled opening date.</p>
<p>A preliminary <a href="next/rules.html">IOCCC rules</a>, preliminary <a href="next/guidelines.html">IOCCC guidelines</a>, and preliminary <a href="https://github.com/ioccc-src/mkiocccentry">mkiocccentry tools</a> have been posted.</p>
<p>Comments and suggestions on these preliminary items are welcome, see <a href="quick-start.html#feedback">FAQ 0.5</a> for information on how.</p>
<h1 id="status.json">status.json</h1>
<pre><code> {
&quot;no_comment&quot; : &quot;mandatory comment: because comments were removed from the original JSON spec&quot;,
&quot;IOCCC_status_version&quot; : &quot;1.0 2024-03-09&quot;,
&quot;contest_status&quot; : &quot;open&quot;,
&quot;news_update&quot; : &quot;2025-03-15T22:16:27+00:00&quot;,
&quot;status_update&quot; : &quot;2025-03-05T18:15:23+00:00&quot;
&quot;contest_status&quot; : &quot;pending&quot;,
&quot;news_update&quot; : &quot;2025-04-16T16:35:11+00:00&quot;,
&quot;status_update&quot; : &quot;2024-12-29T10:01:35+00:00&quot;
}</code></pre>
<!-- END: next line ends content generated by: bin/status2html.sh -->
+3 -3
View File
@@ -1,7 +1,7 @@
{
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"IOCCC_status_version" : "1.0 2024-03-09",
"contest_status" : "open",
"news_update" : "2025-03-15T22:16:27+00:00",
"status_update" : "2025-03-05T18:15:23+00:00"
"contest_status" : "pending",
"news_update" : "2025-04-16T16:35:11+00:00",
"status_update" : "2024-12-29T10:01:35+00:00"
}
+13
View File
@@ -2834,6 +2834,11 @@ feeling a bit too confident, cocky or even happy :-)</p>
<p><a href="#cody">Cody</a> fixed this to compile with more recent perl versions; the symbol that’s now
<code>PL_na</code> was once <code>na</code>.</p>
<p>Cody also added the <a href="https://github.com/ioccc-src/winner/blob/master/2000/dlowe/try.sh">try.sh</a> script.</p>
<p><a href="#johndalbec">John Dalbec</a> fixed the remaining known bugs in
<a href="2000/dlowe/index.html">2000/dlowe</a> by causing the embedded Perl code in
C in order to perform system-specific tune up of the C runtime environment
necessary to run Perl interpreters. Moreover <a href="#johndalbec">John Dalbec</a>
fixed a buffering problem by forcing a <code>flush(3)</code> after every write or print.</p>
<p>Jump to: <a href="#">top</a></p>
<div id="2000_jarijyrki">
<h2 id="winning-entry-2000jarijyrki">Winning entry: <a href="2000/jarijyrki/index.html">2000/jarijyrki</a></h2>
@@ -5232,6 +5237,14 @@ fixes were <strong>EXTREMELY TECHNICALLY CHALLENGING</strong>, like
<a href="thanks-for-help.html#2001_ctk">2001/ctk</a>. <strong>THANK YOU VERY MUCH</strong> for
your help!</p>
<p>Jump to: <a href="#">top</a></p>
<div id="johndalbec">
<h3 id="john-dalbec">John Dalbec</h3>
</div>
<p><a href="authors.html#John_Dalbec">John Dalbec</a> supplied a fix to
<a href="thanks-for-help.html#2000_dlowe">2000/dlowe</a>.</p>
<p><a href="https://github.com/ioccc-src/winner/pull/134">John Dalbec’s patch of 2000/dlowe</a>
is a good example of <a href="bugs.html#general-request-on-original-code">applying a minimal patch</a>
to the <a href="https://github.com/ioccc-src/winner/blob/master/2000/dlowe/dlowe.orig.c">original 2000/dlowe</a> source code.</p>
<div id="neglect">
<h2 id="did-we-neglect-to-credit-you">Did we neglect to credit you?</h2>
</div>
+18
View File
@@ -3556,6 +3556,12 @@ Jump to: [top](#)
Cody also added the [try.sh](%%REPO_URL%%/2000/dlowe/try.sh) script.
[John Dalbec](#johndalbec) fixed the remaining known bugs in
[2000/dlowe](2000/dlowe/index.html) by causing the embedded Perl code in
C in order to perform system-specific tune up of the C runtime environment
necessary to run Perl interpreters. Moreover [John Dalbec](#johndalbec)
fixed a buffering problem by forcing a `flush(3)` after every write or print.
Jump to: [top](#)
@@ -7185,6 +7191,18 @@ your help!
Jump to: [top](#)
<div id="johndalbec">
### John Dalbec
</div>
[John Dalbec](authors.html#John_Dalbec) supplied a fix to
[2000/dlowe](thanks-for-help.html#2000_dlowe).
[John Dalbec's patch of 2000/dlowe](%%REPO_TOP_URL%%/pull/134)
is a good example of [applying a minimal patch](bugs.html#general-request-on-original-code)
to the [original 2000/dlowe](%%REPO_URL%%/2000/dlowe/dlowe.orig.c) source code.
<div id="neglect">
## Did we neglect to credit you?
</div>