reduce link shout in 1991/brnstnd/sorta.README.md
Ran `make gen_other_html` to perform the above.
This commit is contained in:
1 parent
8d49e1305a
commit
6aa287337f
2 files changed
+26
-26
No files matched your search
@@ -378,15 +378,15 @@
|
|||||||
|
|
||||||
<!-- BEFORE: 1st line of markdown file: 1991/brnstnd/sorta.README.md -->
|
<!-- BEFORE: 1st line of markdown file: 1991/brnstnd/sorta.README.md -->
|
||||||
<p>The <code>sorta</code> scripts described below can sorta be found in this directory.</p>
|
<p>The <code>sorta</code> scripts described below can sorta be found in this directory.</p>
|
||||||
<h1 id="sorta.i22"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.i2+2">sorta.i2+2</a></h1>
|
<h2 id="sorta.i22"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.i2+2">sorta.i2+2</a></h2>
|
||||||
<pre><code> 2 2+#` [ about as basic as you can get ]ld</code></pre>
|
<pre><code> 2 2+#` [ about as basic as you can get ]ld</code></pre>
|
||||||
<p>This script takes 2, adds 2 to it, and prints the result (with a
|
<p>This script takes 2, adds 2 to it, and prints the result (with a
|
||||||
newline). I get 5 on the hand-held Sinclair under ZYNIX. Let me know if
|
newline). I get 5 on the hand-held Sinclair under ZYNIX. Let me know if
|
||||||
your machine produces a different result so that I can send you patches.</p>
|
your machine produces a different result so that I can send you patches.</p>
|
||||||
<h1 id="sorta.iarg0"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iarg0">sorta.iarg0</a></h1>
|
<h2 id="sorta.iarg0"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iarg0">sorta.iarg0</a></h2>
|
||||||
<pre><code> 0A` [ take arg 0, print it ]</code></pre>
|
<pre><code> 0A` [ take arg 0, print it ]</code></pre>
|
||||||
<p>This is self-explanatory.</p>
|
<p>This is self-explanatory.</p>
|
||||||
<h1 id="sorta.icalc"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.icalc">sorta.icalc</a></h1>
|
<h2 id="sorta.icalc"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.icalc">sorta.icalc</a></h2>
|
||||||
<pre><code> [D2sD3s]:Dld [ input m n, output m n m n ]ld
|
<pre><code> [D2sD3s]:Dld [ input m n, output m n m n ]ld
|
||||||
|
|
||||||
[2*1=d]:cld [ aux routine for :d recursion ]ld
|
[2*1=d]:cld [ aux routine for :d recursion ]ld
|
||||||
@@ -428,43 +428,43 @@ its arguments. Can you see how? (Hint: Try <code>./sorta "2 2+" 3 < sorta.ica
|
|||||||
Look at program A.) <code>icalc</code> also provides a useful binary output routine,
|
Look at program A.) <code>icalc</code> also provides a useful binary output routine,
|
||||||
and if you can’t remember offhand that <code>D2sD3s&2sD&1sD&&&D&</code> means XOR,
|
and if you can’t remember offhand that <code>D2sD3s&2sD&1sD&&&D&</code> means XOR,
|
||||||
you can just look it up here.</p>
|
you can just look it up here.</p>
|
||||||
<h1 id="sorta.idup"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.idup">sorta.idup</a></h1>
|
<h2 id="sorta.idup"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.idup">sorta.idup</a></h2>
|
||||||
<pre><code> [ld#1_+1=y]:x
|
<pre><code> [ld#1_+1=y]:x
|
||||||
[uD1+=x]:y
|
[uD1+=x]:y
|
||||||
0""1=y`</code></pre>
|
0""1=y`</code></pre>
|
||||||
<p>This script prints out the maximum file descriptor available from
|
<p>This script prints out the maximum file descriptor available from
|
||||||
repeated <code>dup(2)</code>s—usually <code>NOFILE - 1</code>. Can you see how it works?</p>
|
repeated <code>dup(2)</code>s—usually <code>NOFILE - 1</code>. Can you see how it works?</p>
|
||||||
<h1 id="sorta.iecho"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iecho">sorta.iecho</a></h1>
|
<h2 id="sorta.iecho"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iecho">sorta.iecho</a></h2>
|
||||||
<pre><code> [" "$ld]:sld [ print a space ]ld
|
<pre><code> [" "$ld]:sld [ print a space ]ld
|
||||||
[1s1+DA$ld1s1_+D=sD=x]:xld [ given n (argc-n), print args ]ld
|
[1s1+DA$ld1s1_+D=sD=x]:xld [ given n (argc-n), print args ]ld
|
||||||
0a1_+D=x""` [ simulation of /bin/echo ]ld</code></pre>
|
0a1_+D=x""` [ simulation of /bin/echo ]ld</code></pre>
|
||||||
<p>This is a clone of <code>/bin/echo</code>, minus any argument processing and escape
|
<p>This is a clone of <code>/bin/echo</code>, minus any argument processing and escape
|
||||||
interpretation. (Note that, unlike some shells’ echo, <code>/bin/echo</code> prints a
|
interpretation. (Note that, unlike some shells’ echo, <code>/bin/echo</code> prints a
|
||||||
newline even with no arguments.) Try <code>./sorta foo bar < iecho</code>.</p>
|
newline even with no arguments.) Try <code>./sorta foo bar < iecho</code>.</p>
|
||||||
<h1 id="sorta.ifact1"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact1">sorta.ifact1</a></h1>
|
<h2 id="sorta.ifact1"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact1">sorta.ifact1</a></h2>
|
||||||
<pre><code> 1#`ld2*#`ld3*#`ld4*#`ld5*#`ld6*#`ld7*#`ld8*#`ld9*#`ld10*#`ld</code></pre>
|
<pre><code> 1#`ld2*#`ld3*#`ld4*#`ld5*#`ld6*#`ld7*#`ld8*#`ld9*#`ld10*#`ld</code></pre>
|
||||||
<p>This is a very straightforward factorial program: Take 1, print it,
|
<p>This is a very straightforward factorial program: Take 1, print it,
|
||||||
multiply by 2, print it, multiply by 3, print it, etc.</p>
|
multiply by 2, print it, multiply by 3, print it, etc.</p>
|
||||||
<h1 id="sorta.ifact2"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact2">sorta.ifact2</a></h1>
|
<h2 id="sorta.ifact2"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact2">sorta.ifact2</a></h2>
|
||||||
<pre><code> [1+D2s*#`ld1s]:f
|
<pre><code> [1+D2s*#`ld1s]:f
|
||||||
1 0
|
1 0
|
||||||
1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f</code></pre>
|
1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f 1=f</code></pre>
|
||||||
<p><code>ifact1</code> does a lot of repeated work. <code>ifact2</code> takes advantage of this by
|
<p><code>ifact1</code> does a lot of repeated work. <code>ifact2</code> takes advantage of this by
|
||||||
keeping the current <code>n!</code> <code>n</code> on the stack. Each call to routine <code>f (1=f)</code>
|
keeping the current <code>n!</code> <code>n</code> on the stack. Each call to routine <code>f (1=f)</code>
|
||||||
increments <code>n</code> by <code>1</code> and prints out the factorial.</p>
|
increments <code>n</code> by <code>1</code> and prints out the factorial.</p>
|
||||||
<h1 id="sorta.ifact3"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact3">sorta.ifact3</a></h1>
|
<h2 id="sorta.ifact3"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact3">sorta.ifact3</a></h2>
|
||||||
<pre><code> [1+D2s*#`ld1s]:f [ given (n-1)! (n-1), print n!, put n! n ]
|
<pre><code> [1+D2s*#`ld1s]:f [ given (n-1)! (n-1), print n!, put n! n ]
|
||||||
[2s1=f2s1_+D0>=x]:x [ given n n! x, print (n+1)! through (n+x)! ]
|
[2s1=f2s1_+D0>=x]:x [ given n n! x, print (n+1)! through (n+x)! ]
|
||||||
0 1 10 1=x</code></pre>
|
0 1 10 1=x</code></pre>
|
||||||
<p>Finally, <code>ifact3</code> removes all the redundancy from <code>ifact2</code>, and exhibits
|
<p>Finally, <code>ifact3</code> removes all the redundancy from <code>ifact2</code>, and exhibits
|
||||||
proper documentation of stack routines. You can replace the <code>10</code> by
|
proper documentation of stack routines. You can replace the <code>10</code> by
|
||||||
anything in this version.</p>
|
anything in this version.</p>
|
||||||
<h1 id="sorta.iio"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iio">sorta.iio</a></h1>
|
<h2 id="sorta.iio"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iio">sorta.iio</a></h2>
|
||||||
<pre><code> [ a simple example of interpreting code on the fly ]ld
|
<pre><code> [ a simple example of interpreting code on the fly ]ld
|
||||||
|
|
||||||
["] "2 2+":xT ["]T " produces "T 1=x#T " which should be 4."T`</code></pre>
|
["] "2 2+":xT ["]T " produces "T 1=x#T " which should be 4."T`</code></pre>
|
||||||
<p>Notice that <code>"2 2+"</code> is a literal string inside the program.</p>
|
<p>Notice that <code>"2 2+"</code> is a literal string inside the program.</p>
|
||||||
<h1 id="sorta.irot13"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.irot13">sorta.irot13</a></h1>
|
<h2 id="sorta.irot13"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.irot13">sorta.irot13</a></h2>
|
||||||
<pre><code> "[] [.tr] "
|
<pre><code> "[] [.tr] "
|
||||||
["]".[a-m][n-z][A-M][N-Z]"[" ]TTT ["]".[n-z][a-m][N-Z][A-M]"[" ]TTT
|
["]".[a-m][n-z][A-M][N-Z]"[" ]TTT ["]".[n-z][a-m][N-Z][A-M]"[" ]TTT
|
||||||
"[tr] !q"T:xld
|
"[tr] !q"T:xld
|
||||||
@@ -481,7 +481,7 @@ spots. <code>1A 0 0 o</code> opens <code>argv[1]</code>; the <code>'</code> keep
|
|||||||
subroutine <code>h</code> to print a nice error message if necessary. <code>0Ou</code> closes
|
subroutine <code>h</code> to print a nice error message if necessary. <code>0Ou</code> closes
|
||||||
stdout and replaces it with the new descriptor. Finally, subroutine <code>x</code>
|
stdout and replaces it with the new descriptor. Finally, subroutine <code>x</code>
|
||||||
executes the <code>tr</code>.</p>
|
executes the <code>tr</code>.</p>
|
||||||
<h1 id="sorta.isleep"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.isleep">sorta.isleep</a></h1>
|
<h2 id="sorta.isleep"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.isleep">sorta.isleep</a></h2>
|
||||||
<pre><code> ["" "+sleep" "+5" "sleep" !q]:S [F0>1_+=S]:s
|
<pre><code> ["" "+sleep" "+5" "sleep" !q]:S [F0>1_+=S]:s
|
||||||
"forking sleep 5..."`ld
|
"forking sleep 5..."`ld
|
||||||
1=s
|
1=s
|
||||||
@@ -489,13 +489,13 @@ executes the <code>tr</code>.</p>
|
|||||||
w
|
w
|
||||||
"done, sleep exit code " #T`</code></pre>
|
"done, sleep exit code " #T`</code></pre>
|
||||||
<p>This script illustrates the classic fork-exec-wait.</p>
|
<p>This script illustrates the classic fork-exec-wait.</p>
|
||||||
<h1 id="sorta.itailrec"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.itailrec">sorta.itailrec</a></h1>
|
<h2 id="sorta.itailrec"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.itailrec">sorta.itailrec</a></h2>
|
||||||
<pre><code> [3*#" "T$ldD=f]:f
|
<pre><code> [3*#" "T$ldD=f]:f
|
||||||
1=f</code></pre>
|
1=f</code></pre>
|
||||||
<p>The sole purpose of this script is to prove that <code>sorta</code> can do infinite
|
<p>The sole purpose of this script is to prove that <code>sorta</code> can do infinite
|
||||||
tail recursion (in this case, in program <code>f</code>). Do <code>./sorta < itailrec | more</code>
|
tail recursion (in this case, in program <code>f</code>). Do <code>./sorta < itailrec | more</code>
|
||||||
and watch the powers of 3 (mod your computer’s word size) flow by.</p>
|
and watch the powers of 3 (mod your computer’s word size) flow by.</p>
|
||||||
<h1 id="sorta.iwhosort"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iwhosort">sorta.iwhosort</a></h1>
|
<h2 id="sorta.iwhosort"><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iwhosort">sorta.iwhosort</a></h2>
|
||||||
<pre><code> [0Ou "" "+-u" "sort" !q]:S [F0>1_+=S]:s
|
<pre><code> [0Ou "" "+-u" "sort" !q]:S [F0>1_+=S]:s
|
||||||
[1Ou "" "+-u" "who" !q]:W [F0>1_+=W]:w
|
[1Ou "" "+-u" "who" !q]:W [F0>1_+=W]:w
|
||||||
P1=wO1=sOww</code></pre>
|
P1=wO1=sOww</code></pre>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The `sorta` scripts described below can sorta be found in this directory.
|
The `sorta` scripts described below can sorta be found in this directory.
|
||||||
|
|
||||||
# [sorta.i2+2](%%REPO_URL%%/1991/brnstnd/sorta.i2+2)
|
## [sorta.i2+2](%%REPO_URL%%/1991/brnstnd/sorta.i2+2)
|
||||||
|
|
||||||
```
|
```
|
||||||
2 2+#` [ about as basic as you can get ]ld
|
2 2+#` [ about as basic as you can get ]ld
|
||||||
@@ -12,7 +12,7 @@ newline). I get 5 on the hand-held Sinclair under ZYNIX. Let me know if
|
|||||||
your machine produces a different result so that I can send you patches.
|
your machine produces a different result so that I can send you patches.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.iarg0](%%REPO_URL%%/1991/brnstnd/sorta.iarg0)
|
## [sorta.iarg0](%%REPO_URL%%/1991/brnstnd/sorta.iarg0)
|
||||||
|
|
||||||
```
|
```
|
||||||
0A` [ take arg 0, print it ]
|
0A` [ take arg 0, print it ]
|
||||||
@@ -21,7 +21,7 @@ your machine produces a different result so that I can send you patches.
|
|||||||
This is self-explanatory.
|
This is self-explanatory.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.icalc](%%REPO_URL%%/1991/brnstnd/sorta.icalc)
|
## [sorta.icalc](%%REPO_URL%%/1991/brnstnd/sorta.icalc)
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -70,7 +70,7 @@ and if you can't remember offhand that `D2sD3s&2sD&1sD&&&D&` means XOR,
|
|||||||
you can just look it up here.
|
you can just look it up here.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.idup](%%REPO_URL%%/1991/brnstnd/sorta.idup)
|
## [sorta.idup](%%REPO_URL%%/1991/brnstnd/sorta.idup)
|
||||||
|
|
||||||
```
|
```
|
||||||
[ld#1_+1=y]:x
|
[ld#1_+1=y]:x
|
||||||
@@ -82,7 +82,7 @@ This script prints out the maximum file descriptor available from
|
|||||||
repeated `dup(2)`s---usually `NOFILE - 1`. Can you see how it works?
|
repeated `dup(2)`s---usually `NOFILE - 1`. Can you see how it works?
|
||||||
|
|
||||||
|
|
||||||
# [sorta.iecho](%%REPO_URL%%/1991/brnstnd/sorta.iecho)
|
## [sorta.iecho](%%REPO_URL%%/1991/brnstnd/sorta.iecho)
|
||||||
|
|
||||||
```
|
```
|
||||||
[" "$ld]:sld [ print a space ]ld
|
[" "$ld]:sld [ print a space ]ld
|
||||||
@@ -95,7 +95,7 @@ interpretation. (Note that, unlike some shells' echo, `/bin/echo` prints a
|
|||||||
newline even with no arguments.) Try `./sorta foo bar < iecho`.
|
newline even with no arguments.) Try `./sorta foo bar < iecho`.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.ifact1](%%REPO_URL%%/1991/brnstnd/sorta.ifact1)
|
## [sorta.ifact1](%%REPO_URL%%/1991/brnstnd/sorta.ifact1)
|
||||||
|
|
||||||
```
|
```
|
||||||
1#`ld2*#`ld3*#`ld4*#`ld5*#`ld6*#`ld7*#`ld8*#`ld9*#`ld10*#`ld
|
1#`ld2*#`ld3*#`ld4*#`ld5*#`ld6*#`ld7*#`ld8*#`ld9*#`ld10*#`ld
|
||||||
@@ -105,7 +105,7 @@ This is a very straightforward factorial program: Take 1, print it,
|
|||||||
multiply by 2, print it, multiply by 3, print it, etc.
|
multiply by 2, print it, multiply by 3, print it, etc.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.ifact2](%%REPO_URL%%/1991/brnstnd/sorta.ifact2)
|
## [sorta.ifact2](%%REPO_URL%%/1991/brnstnd/sorta.ifact2)
|
||||||
|
|
||||||
```
|
```
|
||||||
[1+D2s*#`ld1s]:f
|
[1+D2s*#`ld1s]:f
|
||||||
@@ -118,7 +118,7 @@ keeping the current `n!` `n` on the stack. Each call to routine `f (1=f)`
|
|||||||
increments `n` by `1` and prints out the factorial.
|
increments `n` by `1` and prints out the factorial.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.ifact3](%%REPO_URL%%/1991/brnstnd/sorta.ifact3)
|
## [sorta.ifact3](%%REPO_URL%%/1991/brnstnd/sorta.ifact3)
|
||||||
|
|
||||||
```
|
```
|
||||||
[1+D2s*#`ld1s]:f [ given (n-1)! (n-1), print n!, put n! n ]
|
[1+D2s*#`ld1s]:f [ given (n-1)! (n-1), print n!, put n! n ]
|
||||||
@@ -131,7 +131,7 @@ proper documentation of stack routines. You can replace the `10` by
|
|||||||
anything in this version.
|
anything in this version.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.iio](%%REPO_URL%%/1991/brnstnd/sorta.iio)
|
## [sorta.iio](%%REPO_URL%%/1991/brnstnd/sorta.iio)
|
||||||
|
|
||||||
```
|
```
|
||||||
[ a simple example of interpreting code on the fly ]ld
|
[ a simple example of interpreting code on the fly ]ld
|
||||||
@@ -142,7 +142,7 @@ anything in this version.
|
|||||||
Notice that `"2 2+"` is a literal string inside the program.
|
Notice that `"2 2+"` is a literal string inside the program.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.irot13](%%REPO_URL%%/1991/brnstnd/sorta.irot13)
|
## [sorta.irot13](%%REPO_URL%%/1991/brnstnd/sorta.irot13)
|
||||||
|
|
||||||
```
|
```
|
||||||
"[] [.tr] "
|
"[] [.tr] "
|
||||||
@@ -165,7 +165,7 @@ stdout and replaces it with the new descriptor. Finally, subroutine `x`
|
|||||||
executes the `tr`.
|
executes the `tr`.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.isleep](%%REPO_URL%%/1991/brnstnd/sorta.isleep)
|
## [sorta.isleep](%%REPO_URL%%/1991/brnstnd/sorta.isleep)
|
||||||
|
|
||||||
```
|
```
|
||||||
["" "+sleep" "+5" "sleep" !q]:S [F0>1_+=S]:s
|
["" "+sleep" "+5" "sleep" !q]:S [F0>1_+=S]:s
|
||||||
@@ -179,7 +179,7 @@ executes the `tr`.
|
|||||||
This script illustrates the classic fork-exec-wait.
|
This script illustrates the classic fork-exec-wait.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.itailrec](%%REPO_URL%%/1991/brnstnd/sorta.itailrec)
|
## [sorta.itailrec](%%REPO_URL%%/1991/brnstnd/sorta.itailrec)
|
||||||
|
|
||||||
```
|
```
|
||||||
[3*#" "T$ldD=f]:f
|
[3*#" "T$ldD=f]:f
|
||||||
@@ -191,7 +191,7 @@ tail recursion (in this case, in program `f`). Do `./sorta < itailrec | more`
|
|||||||
and watch the powers of 3 (mod your computer's word size) flow by.
|
and watch the powers of 3 (mod your computer's word size) flow by.
|
||||||
|
|
||||||
|
|
||||||
# [sorta.iwhosort](%%REPO_URL%%/1991/brnstnd/sorta.iwhosort)
|
## [sorta.iwhosort](%%REPO_URL%%/1991/brnstnd/sorta.iwhosort)
|
||||||
|
|
||||||
```
|
```
|
||||||
[0Ou "" "+-u" "sort" !q]:S [F0>1_+=S]:s
|
[0Ou "" "+-u" "sort" !q]:S [F0>1_+=S]:s
|
||||||
|
|||||||
Reference in new issue
Block a user