improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+46
-46
@@ -1,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
The following bit of perl may help determine the values you need:
|
||||
|
||||
```sh
|
||||
perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"'
|
||||
perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"'
|
||||
```
|
||||
|
||||
... just in case the Makefile does not figure this out for you.
|
||||
@@ -18,8 +18,8 @@ perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"'
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2000 dlowe bugs](../../bugs.html#2000_dlowe).
|
||||
@@ -28,14 +28,14 @@ For more detailed information see [2000 dlowe bugs](../../bugs.html#2000_dlowe).
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./dlowe [file ...]
|
||||
./dlowe [file ...]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ of the submitters hidden until all winning entries have been selected.
|
||||
### Usage
|
||||
|
||||
```
|
||||
./dlowe [file ...]
|
||||
./dlowe [file ...]
|
||||
```
|
||||
|
||||
### Synopsis
|
||||
@@ -74,29 +74,29 @@ based on the `dc(1)` unix calculator.
|
||||
This program understands the following `dc(1)` commands:
|
||||
|
||||
```
|
||||
p prints the top stack value without altering the stack.
|
||||
P prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
f prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
c clears the stack.
|
||||
d pushes a copy of the top stack value onto the stack.
|
||||
r reverses the order of the top two stack values.
|
||||
p prints the top stack value without altering the stack.
|
||||
P prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
f prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
c clears the stack.
|
||||
d pushes a copy of the top stack value onto the stack.
|
||||
r reverses the order of the top two stack values.
|
||||
```
|
||||
|
||||
And the following arithmetic operators are supported:
|
||||
|
||||
```
|
||||
+ Pops 2 values and pushes their sum.
|
||||
- Pops 2 values and pushes the result of subtracting the first
|
||||
from the second.
|
||||
* Pops 2 values and pushes their product.
|
||||
/ Pops 2 values and pushes the result of dividing the second
|
||||
by the first.
|
||||
^ Pops 2 values and pushes the result of raising the second
|
||||
to the power of the first.
|
||||
% Pops 2 values and pushes the remainder of the division that
|
||||
/ would do.
|
||||
+ Pops 2 values and pushes their sum.
|
||||
- Pops 2 values and pushes the result of subtracting the first
|
||||
from the second.
|
||||
* Pops 2 values and pushes their product.
|
||||
/ Pops 2 values and pushes the result of dividing the second
|
||||
by the first.
|
||||
^ Pops 2 values and pushes the result of raising the second
|
||||
to the power of the first.
|
||||
% Pops 2 values and pushes the remainder of the division that
|
||||
/ would do.
|
||||
```
|
||||
|
||||
The precision and range are double, like it or not, except that the
|
||||
@@ -113,34 +113,34 @@ or EOF is encountered.
|
||||
### Diagnostics:
|
||||
|
||||
```
|
||||
"stack empty" Not enough on the stack for the requested command
|
||||
"divide by zero" Attempt to divide by zero
|
||||
"unimplemented" Invalid input
|
||||
Floating point exception (core dumped) (or something to that effect)
|
||||
Bug in Perl_sv_upgrade causes this in some cases when
|
||||
the results of an operation are really huge (> 10^308)
|
||||
This bug appears to be fixed in perl5.6.0
|
||||
"stack empty" Not enough on the stack for the requested command
|
||||
"divide by zero" Attempt to divide by zero
|
||||
"unimplemented" Invalid input
|
||||
|
||||
Floating point exception (core dumped) (or something to that effect)
|
||||
Bug in Perl_sv_upgrade causes this in some cases when
|
||||
the results of an operation are really huge (> 10^308)
|
||||
This bug appears to be fixed in perl5.6.0
|
||||
```
|
||||
|
||||
|
||||
### Examples:
|
||||
|
||||
```sh
|
||||
$ echo '12 13 14 15 16 + + + + f' | ./dlowe
|
||||
70
|
||||
$ echo '12 13 14 15 16 17 + - * / p' | ./dlowe
|
||||
-0.0515873015873016
|
||||
$ echo '+' | ./dlowe
|
||||
stack empty
|
||||
$ echo '999999999999999 1 + p' | ./dlowe
|
||||
1e+15
|
||||
$ echo '99999999999999 1 + p' | ./dlowe
|
||||
100000000000000
|
||||
$ echo '12.5 9 % 10 * 15 + f' | ./dlowe
|
||||
50
|
||||
$ echo '7 P 6 d P P 8 p' | ./dlowe | tr 876 tpo
|
||||
poot
|
||||
$ echo '12 13 14 15 16 + + + + f' | ./dlowe
|
||||
70
|
||||
$ echo '12 13 14 15 16 17 + - * / p' | ./dlowe
|
||||
-0.0515873015873016
|
||||
$ echo '+' | ./dlowe
|
||||
stack empty
|
||||
$ echo '999999999999999 1 + p' | ./dlowe
|
||||
1e+15
|
||||
$ echo '99999999999999 1 + p' | ./dlowe
|
||||
100000000000000
|
||||
$ echo '12.5 9 % 10 * 15 + f' | ./dlowe
|
||||
50
|
||||
$ echo '7 P 6 d P P 8 p' | ./dlowe | tr 876 tpo
|
||||
poot
|
||||
```
|
||||
|
||||
### Code Concept:
|
||||
|
||||
+48
-49
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#J_David_Lowe">J. David Lowe</a><br>
|
||||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,19 +141,19 @@ 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></span></code></pre></div>
|
||||
<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></span></code></pre></div>
|
||||
<p>The following bit of perl may help determine the values you need:</p>
|
||||
<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="fu">perl</span> <span class="at">-MConfig</span> <span class="at">-e</span> <span class="st">'print "$Config{archlibexp}/CORE\n"'</span></span></code></pre></div>
|
||||
<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="fu">perl</span> <span class="at">-MConfig</span> <span class="at">-e</span> <span class="st">'print "$Config{archlibexp}/CORE\n"'</span></span></code></pre></div>
|
||||
<p>… just in case the Makefile does not figure this out for you.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<pre><code> STATUS: known bug - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2000_dlowe">2000 dlowe bugs</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<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="ex">./dlowe</span> [file ...]</span></code></pre></div>
|
||||
<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="ex">./dlowe</span> [file ...]</span></code></pre></div>
|
||||
<h2 id="try">Try:</h2>
|
||||
<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">./try.sh</span></span></code></pre></div>
|
||||
<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">./try.sh</span></span></code></pre></div>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>When this entry was submitted the rules of the IOCCC did not prohibit
|
||||
the use of embedded language interpreters. The judges considered
|
||||
@@ -170,32 +169,32 @@ of the submitters hidden until all winning entries have been selected.</li>
|
||||
</ul>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<pre><code>./dlowe [file ...]</code></pre>
|
||||
<pre><code> ./dlowe [file ...]</code></pre>
|
||||
<h3 id="synopsis">Synopsis</h3>
|
||||
<p>This is a <a href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse Polish
|
||||
calculator</a>, loosely
|
||||
based on the <code>dc(1)</code> unix calculator.</p>
|
||||
<h1 id="syntax">Syntax</h1>
|
||||
<p>This program understands the following <code>dc(1)</code> commands:</p>
|
||||
<pre><code>p prints the top stack value without altering the stack.
|
||||
P prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
f prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
c clears the stack.
|
||||
d pushes a copy of the top stack value onto the stack.
|
||||
r reverses the order of the top two stack values.</code></pre>
|
||||
<pre><code> p prints the top stack value without altering the stack.
|
||||
P prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
f prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
c clears the stack.
|
||||
d pushes a copy of the top stack value onto the stack.
|
||||
r reverses the order of the top two stack values.</code></pre>
|
||||
<p>And the following arithmetic operators are supported:</p>
|
||||
<pre><code> + Pops 2 values and pushes their sum.
|
||||
- Pops 2 values and pushes the result of subtracting the first
|
||||
from the second.
|
||||
* Pops 2 values and pushes their product.
|
||||
/ Pops 2 values and pushes the result of dividing the second
|
||||
by the first.
|
||||
^ Pops 2 values and pushes the result of raising the second
|
||||
to the power of the first.
|
||||
% Pops 2 values and pushes the remainder of the division that
|
||||
/ would do.</code></pre>
|
||||
<pre><code> + Pops 2 values and pushes their sum.
|
||||
- Pops 2 values and pushes the result of subtracting the first
|
||||
from the second.
|
||||
* Pops 2 values and pushes their product.
|
||||
/ Pops 2 values and pushes the result of dividing the second
|
||||
by the first.
|
||||
^ Pops 2 values and pushes the result of raising the second
|
||||
to the power of the first.
|
||||
% Pops 2 values and pushes the remainder of the division that
|
||||
/ would do.</code></pre>
|
||||
<p>The precision and range are double, like it or not, except that the
|
||||
modulus operator actually returns <code>(p1 - (p2 * (p1 / p2)))</code>, but with
|
||||
the innermost division calculated at integer precision. This is
|
||||
@@ -205,29 +204,29 @@ the command line. Unlike <code>dc(1)</code>, multiple commands on the same line
|
||||
must be space separated. Commands are only executed when a newline
|
||||
or EOF is encountered.</p>
|
||||
<h3 id="diagnostics">Diagnostics:</h3>
|
||||
<pre><code>"stack empty" Not enough on the stack for the requested command
|
||||
"divide by zero" Attempt to divide by zero
|
||||
"unimplemented" Invalid input
|
||||
Floating point exception (core dumped) (or something to that effect)
|
||||
Bug in Perl_sv_upgrade causes this in some cases when
|
||||
the results of an operation are really huge (> 10^308)
|
||||
This bug appears to be fixed in perl5.6.0
|
||||
</code></pre>
|
||||
<pre><code> "stack empty" Not enough on the stack for the requested command
|
||||
"divide by zero" Attempt to divide by zero
|
||||
"unimplemented" Invalid input
|
||||
|
||||
Floating point exception (core dumped) (or something to that effect)
|
||||
Bug in Perl_sv_upgrade causes this in some cases when
|
||||
the results of an operation are really huge (> 10^308)
|
||||
This bug appears to be fixed in perl5.6.0</code></pre>
|
||||
<h3 id="examples">Examples:</h3>
|
||||
<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> echo <span class="st">'12 13 14 15 16 + + + + f'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="ex">70</span></span>
|
||||
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">'12 13 14 15 16 17 + - * / p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="ex">-0.0515873015873016</span></span>
|
||||
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">'+'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="ex">stack</span> empty</span>
|
||||
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">'999999999999999 1 + p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a><span class="ex">1e+15</span></span>
|
||||
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">'99999999999999 1 + p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a><span class="ex">100000000000000</span></span>
|
||||
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">'12.5 9 % 10 * 15 + f'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a><span class="ex">50</span></span>
|
||||
<span id="cb10-13"><a href="#cb10-13" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">'7 P 6 d P P 8 p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span> <span class="kw">|</span> <span class="fu">tr</span> 876 tpo</span>
|
||||
<span id="cb10-14"><a href="#cb10-14" aria-hidden="true" tabindex="-1"></a><span class="ex">poot</span></span></code></pre></div>
|
||||
<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> echo <span class="st">'12 13 14 15 16 + + + + f'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">70</span></span>
|
||||
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">'12 13 14 15 16 17 + - * / p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">-0.0515873015873016</span></span>
|
||||
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">'+'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">stack</span> empty</span>
|
||||
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">'999999999999999 1 + p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a> <span class="ex">1e+15</span></span>
|
||||
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">'99999999999999 1 + p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a> <span class="ex">100000000000000</span></span>
|
||||
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">'12.5 9 % 10 * 15 + f'</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
|
||||
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a> <span class="ex">50</span></span>
|
||||
<span id="cb10-13"><a href="#cb10-13" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> echo <span class="st">'7 P 6 d P P 8 p'</span> <span class="kw">|</span> <span class="ex">./dlowe</span> <span class="kw">|</span> <span class="fu">tr</span> 876 tpo</span>
|
||||
<span id="cb10-14"><a href="#cb10-14" aria-hidden="true" tabindex="-1"></a> <span class="ex">poot</span></span></code></pre></div>
|
||||
<h3 id="code-concept">Code Concept:</h3>
|
||||
<p>We all know that Perl and other VHLLs (very high level languages)
|
||||
are particularly well-suited for (among other things) string
|
||||
|
||||
Reference in new issue
Block a user