set pandoc 8 character tab stops for HTML conversion
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 "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`. Performed `make www` to perform the above and test under macOS.
This commit is contained in:
1 parent
7141a1b808
commit
b84c27ce02
402 files changed
+2414
-2396
No files matched your search
@@ -300,11 +300,11 @@ when compiled depending on the compiler.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -374,7 +374,7 @@ when compiled depending on the compiler.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -237,11 +237,11 @@ Observation: “if it ends in a zero, it is divisible by ten”.</li>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -306,7 +306,7 @@ Observation: “if it ends in a zero, it is divisible by ten”.</li>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
+3
-3
@@ -164,11 +164,11 @@ P1003 subcommittee.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -233,7 +233,7 @@ P1003 subcommittee.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
+22
-22
@@ -207,36 +207,36 @@ place to site some references on the AE, but I don’t have any.</p>
|
||||
<h3 id="definition-of-the-input-language-to-buzzard.1-or-what-exactly-do-all-the-macros-do">Definition of the input language to buzzard.1 (OR What Exactly Do All The Macros Do?)</h3>
|
||||
<p>[Don’t read this unless you’re stumped!]</p>
|
||||
<pre><code>
|
||||
MACRO FUNCTION MNEMONIC
|
||||
MACRO FUNCTION MNEMONIC
|
||||
|
||||
V begin variable declarations Variable
|
||||
C begin program Code
|
||||
V begin variable declarations Variable
|
||||
C begin program Code
|
||||
|
||||
Q(b,a) let b = a eQuals
|
||||
A(c,a,b) let c = a + b Add
|
||||
S(c,a,b) let c = a - b Subtract
|
||||
Q(b,a) let b = a eQuals
|
||||
A(c,a,b) let c = a + b Add
|
||||
S(c,a,b) let c = a - b Subtract
|
||||
D(c,a,b) let c = a / b, where b is a *constant* Divide
|
||||
U(c,a,b) let c = a / b, where b is anything Unknown
|
||||
M(c,a,b) let c = a * b Multiply
|
||||
M(c,a,b) let c = a * b Multiply
|
||||
|
||||
O(c,a,b) let c = a boolean-or b (a,b are 0 or 1) Or
|
||||
B(b, a) let b = boolean value of a Boolean
|
||||
P(b, a) let b = 1 if a>0, else 0. Positive
|
||||
B(b, a) let b = boolean value of a Boolean
|
||||
P(b, a) let b = 1 if a>0, else 0. Positive
|
||||
|
||||
l emit next sequential label Label
|
||||
J(x) goto label #x Jump
|
||||
l emit next sequential label Label
|
||||
J(x) goto label #x Jump
|
||||
|
||||
Z(a,d) if a is 0 goto d (a is 0 or 1) Zero
|
||||
E(a,d) if a is 1 goto d (a is 0 or 1) Else
|
||||
Z(a,d) if a is 0 goto d (a is 0 or 1) Zero
|
||||
E(a,d) if a is 1 goto d (a is 0 or 1) Else
|
||||
|
||||
H halt Haly
|
||||
H halt Haly
|
||||
|
||||
K(x) let x = number of cmd line arguments Kount
|
||||
G(x,y) let x = the value if the yth argument Get argument
|
||||
|
||||
T end of code; begin output section Terminate
|
||||
X(y) print out hexadecimal value of y heXadecimal
|
||||
T end of output section and program Terminate</code></pre>
|
||||
T end of code; begin output section Terminate
|
||||
X(y) print out hexadecimal value of y heXadecimal
|
||||
T end of output section and program Terminate</code></pre>
|
||||
<p>You can figure out the other macros yourself. In the sample program, I’ve
|
||||
actually implemented subroutines by saving a return address in a variable and
|
||||
then jumping to a routine– specifically, a routine that converts a number into
|
||||
@@ -256,8 +256,8 @@ ourselves to two operand operations:</p>
|
||||
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>temp <span class="op">-=</span> y<span class="op">;</span> <span class="op">(</span>temp <span class="op">==</span> z<span class="op">-</span>y<span class="op">)</span></span>
|
||||
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>temp <span class="op">*=</span> x<span class="op">;</span> <span class="op">(</span>temp <span class="op">==</span> <span class="op">(</span>z<span class="op">-</span>y<span class="op">)*</span>x<span class="op">)</span></span>
|
||||
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a>y <span class="op">+=</span> temp<span class="op">;</span> <span class="op">(</span>y <span class="op">==</span> <span class="op">(</span>z<span class="op">-</span>y<span class="op">)*</span>x <span class="op">+</span> y<span class="op">)</span></span>
|
||||
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span> <span class="op">==</span> z<span class="op">*</span>x <span class="op">-</span> y<span class="op">*</span>x <span class="op">+</span> y<span class="op">)</span></span>
|
||||
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span> <span class="op">==</span> z<span class="op">*</span>x <span class="op">+</span> y<span class="op">*(</span><span class="dv">1</span><span class="op">-</span>x<span class="op">))</span></span></code></pre></div>
|
||||
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span> <span class="op">==</span> z<span class="op">*</span>x <span class="op">-</span> y<span class="op">*</span>x <span class="op">+</span> y<span class="op">)</span></span>
|
||||
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span> <span class="op">==</span> z<span class="op">*</span>x <span class="op">+</span> y<span class="op">*(</span><span class="dv">1</span><span class="op">-</span>x<span class="op">))</span></span></code></pre></div>
|
||||
<p>Next we imagine we have a <a href="https://en.wikipedia.org/wiki/Program_counter">pc</a>.
|
||||
“I’m supposed to execute statement pc next”, says our emulator. But suppose
|
||||
we’re not currently coming up on statement pc. To handle this, we simply make
|
||||
@@ -291,11 +291,11 @@ dedicated to the memory of Charles Barrett.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -358,7 +358,7 @@ dedicated to the memory of Charles Barrett.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -149,11 +149,11 @@
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -188,64 +188,64 @@ when they are used. Normal instructions compile a pointer to their
|
||||
executable part onto the end of the dictionary. As we will see, this
|
||||
means that by default FIRST simply compiles things.</p>
|
||||
<h4 id="integer-operations">Integer Operations</h4>
|
||||
<pre><code>SYMBOL NAME FUNCTION
|
||||
<pre><code>SYMBOL NAME FUNCTION
|
||||
|
||||
- binary minus pop top 2 elements of stack, subtract, push
|
||||
- binary minus pop top 2 elements of stack, subtract, push
|
||||
|
||||
* multiply pop top 2 elements of stack, multiply, push
|
||||
* multiply pop top 2 elements of stack, multiply, push
|
||||
|
||||
/ divide pop top 2 elements of stack, divide, push
|
||||
/ divide pop top 2 elements of stack, divide, push
|
||||
|
||||
<0 less than 0 pop top element of stack, push 1 if < 0 else 0</code></pre>
|
||||
<0 less than 0 pop top element of stack, push 1 if < 0 else 0</code></pre>
|
||||
<p>Note that we can synthesize addition and negation from binary minus,
|
||||
but we cannot synthesize a time efficient divide or multiply from it.
|
||||
<code><0</code> is synthesize-able, but only in a non-portable way.</p>
|
||||
<h4 id="memory-operations">Memory Operations</h4>
|
||||
<pre><code>SYMBOL NAME FUNCTION
|
||||
<pre><code>SYMBOL NAME FUNCTION
|
||||
|
||||
@ fetch pop top of stack, treat as address to push contents of
|
||||
@ fetch pop top of stack, treat as address to push contents of
|
||||
|
||||
! store top of stack is address, 2nd is value; store to memory
|
||||
and pop both off the stack</code></pre>
|
||||
! store top of stack is address, 2nd is value; store to memory
|
||||
and pop both off the stack</code></pre>
|
||||
<h4 id="inputoutput-operations">Input/Output Operations</h4>
|
||||
<pre><code>NAME FUNCTION
|
||||
<pre><code>NAME FUNCTION
|
||||
|
||||
echo output top of stack through C's putchar()
|
||||
echo output top of stack through C's putchar()
|
||||
|
||||
key push C's getchar() onto top of stack
|
||||
key push C's getchar() onto top of stack
|
||||
|
||||
_read read a space-delimited word, find it in the
|
||||
dictionary, and compile a pointer to
|
||||
that word's code pointer onto the
|
||||
current end of the dictionary</code></pre>
|
||||
_read read a space-delimited word, find it in the
|
||||
dictionary, and compile a pointer to
|
||||
that word's code pointer onto the
|
||||
current end of the dictionary</code></pre>
|
||||
<p>Although <code>_read</code> could be synthesized from key, we need <code>_read</code> to be able
|
||||
to compile words to be able to start any syntheses.</p>
|
||||
<h4 id="execution-operations">Execution Operations</h4>
|
||||
<pre><code>NAME FUNCTION
|
||||
<pre><code>NAME FUNCTION
|
||||
|
||||
exit leave the current function: pop the return stack
|
||||
into the program counter</code></pre>
|
||||
exit leave the current function: pop the return stack
|
||||
into the program counter</code></pre>
|
||||
<h4 id="immediate-compilation-operations">Immediate (compilation) Operations</h4>
|
||||
<pre><code>SYMBOL NAME FUNCTION
|
||||
<pre><code>SYMBOL NAME FUNCTION
|
||||
|
||||
: define read in the next space-delimited word, add it to
|
||||
the end of our string storage, and generate
|
||||
a header for the new word so that when it
|
||||
is typed it compiles a pointer to itself
|
||||
so that it can be executed.
|
||||
: define read in the next space-delimited word, add it to
|
||||
the end of our string storage, and generate
|
||||
a header for the new word so that when it
|
||||
is typed it compiles a pointer to itself
|
||||
so that it can be executed.
|
||||
|
||||
immediate immediate when used immediately after a name following a ':',
|
||||
it makes the word being defined run whenever
|
||||
it is typed.</code></pre>
|
||||
immediate immediate when used immediately after a name following a ':',
|
||||
it makes the word being defined run whenever
|
||||
it is typed.</code></pre>
|
||||
<p><code>:</code> cannot be synthesized, because we could not synthesize anything.
|
||||
<code>immediate</code> has to be an immediate operation, so it could not be
|
||||
synthesized unless by default operations were immediate; but that
|
||||
would preclude our being able to do any useful compilation.</p>
|
||||
<h4 id="stack-operations">Stack Operations</h4>
|
||||
<pre><code>NAME FUNCTION
|
||||
<pre><code>NAME FUNCTION
|
||||
|
||||
pick pop top of stack, use as index into stack and copy up
|
||||
that element</code></pre>
|
||||
pick pop top of stack, use as index into stack and copy up
|
||||
that element</code></pre>
|
||||
<p>If the data stack were stored in main memory, we could synthesize <code>pick</code>;
|
||||
but putting the stack and stack pointer in main memory would significantly
|
||||
increase the C source code size.</p>
|
||||
@@ -264,16 +264,16 @@ word internally that it executes as its main loop. This word calls
|
||||
up a word on the return stack, so it will eventually trash things.
|
||||
This is discussed some more in section 2.</p>
|
||||
<p>Here’s a handy summary of all the FIRST words:</p>
|
||||
<pre><code>WORD DESCRIPTION
|
||||
<pre><code>WORD DESCRIPTION
|
||||
|
||||
- * / binary integer operations on the stack
|
||||
<0 is top of stack less than 0?
|
||||
@ ! read from or write to memory
|
||||
echo key output or input one character
|
||||
_read read a word from input and compile a pointer to it
|
||||
exit stop running the current function
|
||||
: compile the header of a definition
|
||||
immediate modify the header to create an immediate word</code></pre>
|
||||
- * / binary integer operations on the stack
|
||||
<0 is top of stack less than 0?
|
||||
@ ! read from or write to memory
|
||||
echo key output or input one character
|
||||
_read read a word from input and compile a pointer to it
|
||||
exit stop running the current function
|
||||
: compile the header of a definition
|
||||
immediate modify the header to create an immediate word</code></pre>
|
||||
<p>Here is a sample FIRST program. I’m assuming you’re using
|
||||
the ASCII character set. FIRST does not depend upon ASCII, but
|
||||
since FIRST has no syntax for character constants, one normally has
|
||||
@@ -286,26 +286,26 @@ differently if you wanted.</p>
|
||||
inside parentheses. FIRST programs cannot have FORTH comments; but I need
|
||||
some device to indicate what’s going on. (THIRD programs are an entirely
|
||||
different subject.)</p>
|
||||
<pre><code> ( Our first line gives the symbols for the built-ins )
|
||||
<pre><code> ( Our first line gives the symbols for the built-ins )
|
||||
: immediate _read @ ! - * / <0 exit echo key _pick
|
||||
|
||||
( now we define a simple word that will print out a couple characters )
|
||||
( now we define a simple word that will print out a couple characters )
|
||||
|
||||
: L ( define a word named 'L' )
|
||||
108 echo ( output an ascii 'l' )
|
||||
: L ( define a word named 'L' )
|
||||
108 echo ( output an ascii 'l' )
|
||||
exit
|
||||
|
||||
: hello ( define a word named 'hello')
|
||||
72 echo ( output an ascii 'H' )
|
||||
101 echo ( output an ascii 'e' )
|
||||
111 ( push ascii 'o' onto the stack )
|
||||
L L ( output two ascii 'l's )
|
||||
echo ( output the 'o' we pushed on the stack before )
|
||||
10 echo ( print a newline )
|
||||
exit ( stop running this routine )
|
||||
: hello ( define a word named 'hello')
|
||||
72 echo ( output an ascii 'H' )
|
||||
101 echo ( output an ascii 'e' )
|
||||
111 ( push ascii 'o' onto the stack )
|
||||
L L ( output two ascii 'l's )
|
||||
echo ( output the 'o' we pushed on the stack before )
|
||||
10 echo ( print a newline )
|
||||
exit ( stop running this routine )
|
||||
|
||||
: test immediate ( define a word named 'test' that runs whenever typed )
|
||||
hello ( call hello )
|
||||
: test immediate ( define a word named 'test' that runs whenever typed )
|
||||
hello ( call hello )
|
||||
exit
|
||||
|
||||
test
|
||||
@@ -362,11 +362,11 @@ word, from which you can never return. What it does is drops the top value off
|
||||
the return stack, calls <code>_read</code>, then calls itself. Because it kills the top of
|
||||
the return stack, it can recurse indefinitely.</p>
|
||||
<pre><code>: ]
|
||||
r @ Get the value of the return stack pointer
|
||||
1 - Subtract one
|
||||
r ! Store it back into the return stack pointer
|
||||
_read Read and compile one word
|
||||
] Start over</code></pre>
|
||||
r @ Get the value of the return stack pointer
|
||||
1 - Subtract one
|
||||
r ! Store it back into the return stack pointer
|
||||
_read Read and compile one word
|
||||
] Start over</code></pre>
|
||||
<p>Notice that we don’t need to exit, since we never come back. Also, it’s
|
||||
possible that an immediate word may get run during <code>_read</code>, and that <code>_read</code>
|
||||
will never return!</p>
|
||||
@@ -376,12 +376,12 @@ main</code></pre>
|
||||
<p>Next off, I’m going to do this the easy but non-portable way, and put some
|
||||
character constant definitions in. I wanted them at the top of the file, but
|
||||
that would have burned too much of the return stack.</p>
|
||||
<pre><code>: '"' 34 exit
|
||||
: ')' 41 exit
|
||||
: '\n' 10 exit
|
||||
<pre><code>: '"' 34 exit
|
||||
: ')' 41 exit
|
||||
: '\n' 10 exit
|
||||
: 'space' 32 exit
|
||||
: '0' 48 exit
|
||||
: '-' 45 exit
|
||||
: '0' 48 exit
|
||||
: '-' 45 exit
|
||||
|
||||
: cr '\n' echo exit</code></pre>
|
||||
<p>Next, we want to define some temporary variables for locations <code>3</code>, <code>4</code>, and
|
||||
@@ -421,18 +421,18 @@ make a generic pointer-advancing function.
|
||||
Given a pointer to a memory location, increment the value
|
||||
at that memory location.</p>
|
||||
<pre><code>: inc
|
||||
dup @ Get another copy of the address, and get the value
|
||||
so now we have value, address on top of stack.
|
||||
1 + Add one to the value
|
||||
swap Swap to put the address on top of the stack
|
||||
! exit Write it to memory
|
||||
dup @ Get another copy of the address, and get the value
|
||||
so now we have value, address on top of stack.
|
||||
1 + Add one to the value
|
||||
swap Swap to put the address on top of the stack
|
||||
! exit Write it to memory
|
||||
</code></pre>
|
||||
<p><code>,</code> is a standard FORTH word. It should write the top of
|
||||
stack into the dictionary, and advance the pointer</p>
|
||||
<pre><code>: ,
|
||||
h @ Get the value of the dictionary pointer
|
||||
! Write the top of stack there
|
||||
h inc And increment the dictionary pointer
|
||||
h @ Get the value of the dictionary pointer
|
||||
! Write the top of stack there
|
||||
h inc And increment the dictionary pointer
|
||||
exit</code></pre>
|
||||
<p><code>'</code> is a standard FORTH word. It should push the address
|
||||
of the word that follows it onto the stack. We could
|
||||
@@ -443,25 +443,25 @@ stack will point into the instruction stream immediately
|
||||
after the <code>'</code>. We push the word there, and advance the
|
||||
return stack pointer so that we don’t execute it.</p>
|
||||
<pre><code>: '
|
||||
r @ Get the address of the top of return stack
|
||||
We currently have a pointer to the top of return stack
|
||||
@ Get the value from there
|
||||
We currently have a pointer to the instruction stream
|
||||
dup Get another copy of it--the bottom copy will stick
|
||||
around until the end of this word
|
||||
1 + Increment the pointer, pointing to the NEXT instruction
|
||||
r @ ! Write it back onto the top of the return stack
|
||||
We currently have our first copy of the old pointer
|
||||
to the instruction stream
|
||||
@ Get the value there--the address of the "next word"
|
||||
r @ Get the address of the top of return stack
|
||||
We currently have a pointer to the top of return stack
|
||||
@ Get the value from there
|
||||
We currently have a pointer to the instruction stream
|
||||
dup Get another copy of it--the bottom copy will stick
|
||||
around until the end of this word
|
||||
1 + Increment the pointer, pointing to the NEXT instruction
|
||||
r @ ! Write it back onto the top of the return stack
|
||||
We currently have our first copy of the old pointer
|
||||
to the instruction stream
|
||||
@ Get the value there--the address of the "next word"
|
||||
exit
|
||||
</code></pre>
|
||||
<p>Now we’re set. <code>;</code> should be an immediate word that pushes
|
||||
the address of <code>exit</code> onto the stack, then writes it out.</p>
|
||||
<pre><code>: ; immediate
|
||||
' exit Get the address of exit
|
||||
, Compile it
|
||||
exit And we should return</code></pre>
|
||||
' exit Get the address of exit
|
||||
, Compile it
|
||||
exit And we should return</code></pre>
|
||||
<p>Now let’s test out <code>;</code> by defining a useful word:</p>
|
||||
<pre><code>: drop 0 * + ;</code></pre>
|
||||
<p>Since we have <code>inc</code>, we ought to make <code>dec</code>:</p>
|
||||
@@ -479,20 +479,20 @@ that off first… We better just bite the bullet and
|
||||
code it out–but we can’t really break it into smaller
|
||||
words, because that’ll trash the return stack.</p>
|
||||
<pre><code>: tor
|
||||
r @ @ Get the value off the top of the return stack
|
||||
swap Bring the value to be pushed to the top of stack
|
||||
r @ ! Write it over the current top of return stack
|
||||
r @ 1 + r ! Increment the return stack pointer--but can't use inc
|
||||
r @ ! Store our return address back on the return stack
|
||||
r @ @ Get the value off the top of the return stack
|
||||
swap Bring the value to be pushed to the top of stack
|
||||
r @ ! Write it over the current top of return stack
|
||||
r @ 1 + r ! Increment the return stack pointer--but can't use inc
|
||||
r @ ! Store our return address back on the return stack
|
||||
;</code></pre>
|
||||
<p>Next we want the opposite routine, which pops the top
|
||||
of the return stack, and puts it on the normal stack.</p>
|
||||
<pre><code>: fromr
|
||||
r @ @ Save old value
|
||||
r @ 1 - r ! Decrement pointer
|
||||
r @ @ Get value that we want off
|
||||
swap Bring return address to top
|
||||
r @ ! Store it and return
|
||||
r @ @ Save old value
|
||||
r @ 1 - r ! Decrement pointer
|
||||
r @ @ Get value that we want off
|
||||
swap Bring return address to top
|
||||
r @ ! Store it and return
|
||||
;</code></pre>
|
||||
<p>Now, if we have a routine that’s recursing, and we
|
||||
want to be polite about the return stack, right before
|
||||
@@ -515,11 +515,11 @@ up.</p>
|
||||
<pre><code>: < - <0 ;</code></pre>
|
||||
<p><code>logical</code> turns the top of stack into either <code>0</code> or <code>1</code>.</p>
|
||||
<pre><code>: logical
|
||||
dup Get two copies of it
|
||||
0 < 1 if < 0, 0 otherwise
|
||||
swap minus Swap number back up, and take negative
|
||||
0 < 1 if original was > 0, 0 otherwise
|
||||
+ Add them up--has to be 0 or 1!
|
||||
dup Get two copies of it
|
||||
0 < 1 if < 0, 0 otherwise
|
||||
swap minus Swap number back up, and take negative
|
||||
0 < 1 if original was > 0, 0 otherwise
|
||||
+ Add them up--has to be 0 or 1!
|
||||
;</code></pre>
|
||||
<p><code>not</code> returns 1 if top of stack is 0, and 0 otherwise</p>
|
||||
<pre><code>: not logical bnot ;</code></pre>
|
||||
@@ -531,12 +531,12 @@ an integer constant with the offset of how far to branch.
|
||||
To branch, we use the return stack to read the offset, and
|
||||
add that on to the top of the return stack, and return.</p>
|
||||
<pre><code>: branch
|
||||
r @ Address of top of return stack
|
||||
@ Our return address
|
||||
@ Value from there: the branch offset
|
||||
r @ @ Our return address again
|
||||
+ The address we want to execute at
|
||||
r @ ! Store it back onto the return stack
|
||||
r @ Address of top of return stack
|
||||
@ Our return address
|
||||
@ Value from there: the branch offset
|
||||
r @ @ Our return address again
|
||||
+ The address we want to execute at
|
||||
r @ ! Store it back onto the return stack
|
||||
;</code></pre>
|
||||
<p>For conditional branches, we want to branch by a certain
|
||||
amount if true, otherwise we want to skip over the branch
|
||||
@@ -548,10 +548,10 @@ following computes the correct branch offset.</p>
|
||||
<p>Branch if the value on top of the stack is <code>0</code>.</p>
|
||||
<pre><code>: notbranch
|
||||
not
|
||||
r @ @ @ Get the branch offset
|
||||
computebranch Adjust as necessary
|
||||
r @ @ + Calculate the new address
|
||||
r @ ! Store it
|
||||
r @ @ @ Get the branch offset
|
||||
computebranch Adjust as necessary
|
||||
r @ @ + Calculate the new address
|
||||
r @ ! Store it
|
||||
;</code></pre>
|
||||
<p><code>here</code> is a standard FORTH word which returns a pointer to
|
||||
the current dictionary address–that is, the value of
|
||||
@@ -564,27 +564,27 @@ we don’t know where the <code>then</code> will be. On the <em>stack</em>
|
||||
we leave the address where we compiled the dummy offset.
|
||||
<code>then</code> will calculate the offset and fill it in for us.</p>
|
||||
<pre><code>: if immediate
|
||||
' notbranch , Compile notbranch
|
||||
here Save the current dictionary address
|
||||
0 , Compile a dummy value
|
||||
' notbranch , Compile notbranch
|
||||
here Save the current dictionary address
|
||||
0 , Compile a dummy value
|
||||
;</code></pre>
|
||||
<p><code>then</code> expects the address to <code>fixup</code> to be on the stack.</p>
|
||||
<pre><code>: then immediate
|
||||
dup Make another copy of the address
|
||||
here Find the current location, where to branch to
|
||||
swap - Calculate the difference between them
|
||||
swap ! Bring the address to the top, and store it.
|
||||
dup Make another copy of the address
|
||||
here Find the current location, where to branch to
|
||||
swap - Calculate the difference between them
|
||||
swap ! Bring the address to the top, and store it.
|
||||
;</code></pre>
|
||||
<p>Now that we can do <code>if...then</code> statements, we can do
|
||||
some parsing! Let’s introduce real FORTH comments.
|
||||
<code>find-)</code> will scan the input until it finds a <code>)</code>, and
|
||||
exit.</p>
|
||||
<pre><code>: find-)
|
||||
key Read in a character
|
||||
')' = Compare it to close parentheses
|
||||
not if If it's not equal
|
||||
tail find-) repeat (popping R stack)
|
||||
then Otherwise branch here and exit
|
||||
key Read in a character
|
||||
')' = Compare it to close parentheses
|
||||
not if If it's not equal
|
||||
tail find-) repeat (popping R stack)
|
||||
then Otherwise branch here and exit
|
||||
;
|
||||
|
||||
: ( immediate
|
||||
@@ -598,35 +598,35 @@ exit.</p>
|
||||
nest parentheses... )
|
||||
|
||||
: else immediate
|
||||
' branch , ( compile a definite branch )
|
||||
here ( push the backpatching address )
|
||||
0 , ( compile a dummy offset for branch )
|
||||
swap ( bring old backpatch address to top )
|
||||
dup here swap - ( calculate the offset from old address )
|
||||
swap ! ( put the address on top and store it )
|
||||
' branch , ( compile a definite branch )
|
||||
here ( push the backpatching address )
|
||||
0 , ( compile a dummy offset for branch )
|
||||
swap ( bring old backpatch address to top )
|
||||
dup here swap - ( calculate the offset from old address )
|
||||
swap ! ( put the address on top and store it )
|
||||
;
|
||||
|
||||
: over _x! _y! _y _x _y ;
|
||||
|
||||
: add
|
||||
_x! ( save the pointer in a temp variable )
|
||||
_x @ ( get the value pointed to )
|
||||
+ ( add the incremement from on top of the stack )
|
||||
_x ! ( and save it )
|
||||
_x! ( save the pointer in a temp variable )
|
||||
_x @ ( get the value pointed to )
|
||||
+ ( add the incremement from on top of the stack )
|
||||
_x ! ( and save it )
|
||||
;
|
||||
|
||||
: allot h add ;
|
||||
|
||||
: maybebranch
|
||||
logical ( force the TOS to be 0 or 1 )
|
||||
r @ @ @ ( load the branch offset )
|
||||
computebranch ( calculate the condition offset [either TOS or 1])
|
||||
r @ @ + ( add it to the return address )
|
||||
r @ ! ( store it to our return address and return )
|
||||
logical ( force the TOS to be 0 or 1 )
|
||||
r @ @ @ ( load the branch offset )
|
||||
computebranch ( calculate the condition offset [either TOS or 1])
|
||||
r @ @ + ( add it to the return address )
|
||||
r @ ! ( store it to our return address and return )
|
||||
;
|
||||
|
||||
: mod _x! _y! ( get x then y off of stack )
|
||||
_y _y _x / _x * ( y - y / x * x )
|
||||
: mod _x! _y! ( get x then y off of stack )
|
||||
_y _y _x / _x * ( y - y / x * x )
|
||||
-
|
||||
;
|
||||
|
||||
@@ -694,10 +694,10 @@ exit.</p>
|
||||
;
|
||||
|
||||
: do immediate
|
||||
' swap , ( compile 'swap' to swap the limit and start )
|
||||
' tor , ( compile to push the limit onto the return stack )
|
||||
' tor , ( compile to push the start on the return stack )
|
||||
here ( save this address so we can branch back to it )
|
||||
' swap , ( compile 'swap' to swap the limit and start )
|
||||
' tor , ( compile to push the limit onto the return stack )
|
||||
' tor , ( compile to push the start on the return stack )
|
||||
here ( save this address so we can branch back to it )
|
||||
;
|
||||
|
||||
: i r @ 1 - @ ;
|
||||
@@ -708,13 +708,13 @@ exit.</p>
|
||||
: >= swap <= ;
|
||||
|
||||
: inci
|
||||
r @ 1 - ( get the pointer to i )
|
||||
inc ( add one to it )
|
||||
r @ 1 - ( get the pointer to i )
|
||||
inc ( add one to it )
|
||||
r @ 1 - @ ( find the value again )
|
||||
r @ 2 - @ ( find the limit value )
|
||||
r @ 2 - @ ( find the limit value )
|
||||
<=
|
||||
if
|
||||
r @ @ @ r @ @ + r @ ! exit ( branch )
|
||||
r @ @ @ r @ @ + r @ ! exit ( branch )
|
||||
then
|
||||
fromr 1 +
|
||||
fromr drop
|
||||
@@ -726,10 +726,10 @@ exit.</p>
|
||||
|
||||
: loopexit
|
||||
|
||||
fromr drop ( pop off our return address )
|
||||
fromr drop ( pop off i )
|
||||
fromr drop ( pop off the limit of i )
|
||||
; ( and return to the caller's caller routine )
|
||||
fromr drop ( pop off our return address )
|
||||
fromr drop ( pop off i )
|
||||
fromr drop ( pop off the limit of i )
|
||||
; ( and return to the caller's caller routine )
|
||||
|
||||
: execute
|
||||
8 !
|
||||
@@ -827,11 +827,11 @@ _welcome</code></pre>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -868,7 +868,7 @@ _welcome</code></pre>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -316,11 +316,11 @@ and thus indirectly inspiring me to write this program.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -398,7 +398,7 @@ and thus indirectly inspiring me to write this program.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
+10
-10
@@ -159,15 +159,15 @@ following locations though the last one is more ironic:</p>
|
||||
<pre><code>/usr/share/dict/words
|
||||
/usr/share/lib/spell/words
|
||||
/usr/ucblib/dict/words
|
||||
/dev/null # <-- for machines with nothing to say</code></pre>
|
||||
/dev/null # <-- for machines with nothing to say</code></pre>
|
||||
<p>Then using the proper dictionary file it does:</p>
|
||||
<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="ex">./ag</span> free software foundation <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> obfuscated c contest <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> unix international <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> george bush <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> bill clinton <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> ross perot <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> paul e tsongas <span class="op"><</span> /usr/share/dict/words</span></code></pre></div>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> obfuscated c contest <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> unix international <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> george bush <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> bill clinton <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> ross perot <span class="op"><</span> /usr/share/dict/words</span>
|
||||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./ag</span> paul e tsongas <span class="op"><</span> /usr/share/dict/words</span></code></pre></div>
|
||||
<p>where <code>/usr/share/dict/words</code> is the dictionary file.</p>
|
||||
<p>Then it uses the <a href="mkdict.sh">mkdict.sh</a> script to create a dictionary file out
|
||||
of the files <a href="README.md">README.md</a>, <a href="try.sh">try.sh</a> (itself) and
|
||||
@@ -341,11 +341,11 @@ the word directly from standard input to standard output.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -409,7 +409,7 @@ the word directly from standard input to standard output.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
+8
-8
@@ -232,23 +232,23 @@ raster size; not a good idea!).</p>
|
||||
<h3 id="options">Options</h3>
|
||||
<p>The options of this program are:</p>
|
||||
<pre><code>-centre x y (float x,y) Centre the picture at x+iy in the complex
|
||||
plane (default x=0 y=0)
|
||||
plane (default x=0 y=0)
|
||||
|
||||
|
||||
-factor f (float f) Use f pixels per unit of the plane (default
|
||||
f=x/4 where x is the width)
|
||||
f=x/4 where x is the width)
|
||||
|
||||
|
||||
-julia x y (float x,y) Draw a julia set. Use x+iy as the constant
|
||||
to add after squaring (default x=0 y=0)
|
||||
to add after squaring (default x=0 y=0)
|
||||
|
||||
-limit l (int l) Use l iterations maximum (default l=128)
|
||||
|
||||
-mask m (int m) Use m as a mask in deciding the colour of each
|
||||
pixel (see below) (default m=1)
|
||||
pixel (see below) (default m=1)
|
||||
|
||||
-size x y (int x,y) Produce an x-by-y output (default for raster
|
||||
x=768 y=768; default for text x=63 y=23)
|
||||
x=768 y=768; default for text x=63 y=23)
|
||||
|
||||
-text Produce text instead of raster.</code></pre>
|
||||
<p>The colour of each point is determined by taking the bitwise AND of the
|
||||
@@ -272,11 +272,11 @@ standard error to indicate its progress (one dot per pixel line).</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -339,7 +339,7 @@ standard error to indicate its progress (one dot per pixel line).</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
+3
-3
@@ -199,11 +199,11 @@ to serve as official taste testers. Yummo!</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -266,7 +266,7 @@ to serve as official taste testers. Yummo!</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -240,11 +240,11 @@ event loop at the end of program. It is not a bug, it’s a feature!</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -307,7 +307,7 @@ event loop at the end of program. It is not a bug, it’s a feature!</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -163,11 +163,11 @@ generates when compiling the source.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -230,7 +230,7 @@ generates when compiling the source.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -165,11 +165,11 @@ number, all the other eight numbers next to it decrease and vice-versa.</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -231,7 +231,7 @@ number, all the other eight numbers next to it decrease and vice-versa.</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -227,11 +227,11 @@ operator, or argument separator?).</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -294,7 +294,7 @@ operator, or argument separator?).</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -148,13 +148,13 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#1992_vern">1992 vern bugs</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<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">./vern</span> 3 <span class="co"># <-- default is 2</span></span></code></pre></div>
|
||||
<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">./vern</span> 3 <span class="co"># <-- default is 2</span></span></code></pre></div>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>You might start off by giving the following input:</p>
|
||||
<pre><code>63 43
|
||||
76 55
|
||||
71 52
|
||||
67 57 # <-- this may take a while</code></pre>
|
||||
67 57 # <-- this may take a while</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>The judges assume no responsibility for the obfuscated opening
|
||||
suggested above. :-)</p>
|
||||
@@ -262,11 +262,11 @@ nearest multiple of <code>4</code>, and then the other constants are derived fro
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -328,7 +328,7 @@ nearest multiple of <code>4</code>, and then the other constants are derived fro
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
@@ -171,10 +171,10 @@ so one can try the same script for both:</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>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>To find the approximate place where this entry was judged, type:</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./whereami</span> 37 <span class="at">-122</span> <span class="co"># </span><span class="al">NOTE</span><span class="co">: - means west of meridian</span></span>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./whereami</span> 37 <span class="at">-122</span> <span class="co"># </span><span class="al">NOTE</span><span class="co">: - means west of meridian</span></span>
|
||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="co"># or if you don't have curses installed:</span></span>
|
||||
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./westley</span> 37 <span class="at">-122</span> <span class="co"># </span><span class="al">NOTE</span><span class="co">: - means west of meridian</span></span></code></pre></div>
|
||||
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./westley</span> 37 <span class="at">-122</span> <span class="co"># </span><span class="al">NOTE</span><span class="co">: - means west of meridian</span></span></code></pre></div>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<p>Run the program with your latitude & longitude as integer
|
||||
arguments; it will produce a map made up of <code>'!'</code> with the given
|
||||
@@ -258,11 +258,11 @@ joined together as one 160-character line and listed. You should see:</p>
|
||||
|
||||
You are free to share and adapt this file under the terms of this license:
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||||
|
||||
For more information, see:
|
||||
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
-->
|
||||
|
||||
@@ -330,7 +330,7 @@ joined together as one 160-character line and listed. You should see:</p>
|
||||
<div class="footer">
|
||||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||||
<p>This file and web page is:</p>
|
||||
<blockquote><p><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></blockquote>
|
||||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||||
<p>For more information, see:</p>
|
||||
|
||||
Reference in new issue
Block a user