Merge pull request #2512 from xexyl/html-quotes

Fix code blocks in 1991 and part of 1992
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-06-29 15:12:31 -07:00
commit 4d83621ada
23 files changed
+119 -146

No files matched your search

+20 -7
View File
@@ -88,12 +88,24 @@ results depending on the implementation of `curses`.
### Commands ### Commands
``` ```
h j k l left, down, up, right cursor movement h j k l left,
H J K L word left, page down, page up, word right down,
[ ] beginning and end of line up,
t b top and bottom of file right
i enter insert mode, form-feed to quit cursor movement
x delete character under the cursor H J K L word left,
page down,
page up,
word right
[ ] beginning and
end of line
t b top and bottom
of file
i enter insert
mode, form-feed
to quit
x delete character
under the cursor
W write buffer to file W write buffer to file
R refresh the screen R refresh the screen
Q quit Q quit
@@ -104,7 +116,8 @@ results depending on the implementation of `curses`.
``` ```
0 success 0 success
2 missing edit filename 2 missing edit
filename
``` ```
+20 -7
View File
@@ -448,18 +448,31 @@ Carriage return is mapped to newline on input and ignored on output. Tab stops
are every eight columns. Non-printable characters may have unpredictable are every eight columns. Non-printable characters may have unpredictable
results depending on the implementation of <code>curses</code>.</p> results depending on the implementation of <code>curses</code>.</p>
<h3 id="commands">Commands</h3> <h3 id="commands">Commands</h3>
<pre><code> h j k l left, down, up, right cursor movement <pre><code> h j k l left,
H J K L word left, page down, page up, word right down,
[ ] beginning and end of line up,
t b top and bottom of file right
i enter insert mode, form-feed to quit cursor movement
x delete character under the cursor H J K L word left,
page down,
page up,
word right
[ ] beginning and
end of line
t b top and bottom
of file
i enter insert
mode, form-feed
to quit
x delete character
under the cursor
W write buffer to file W write buffer to file
R refresh the screen R refresh the screen
Q quit</code></pre> Q quit</code></pre>
<h3 id="exit-status">Exit status</h3> <h3 id="exit-status">Exit status</h3>
<pre><code> 0 success <pre><code> 0 success
2 missing edit filename</code></pre> 2 missing edit
filename</code></pre>
<h3 id="about-this-entry">About this entry</h3> <h3 id="about-this-entry">About this entry</h3>
<p>The <code>BUF</code> size should be set at compile time to 32767. This value was used <p>The <code>BUF</code> size should be set at compile time to 32767. This value was used
because the Sozobon C compiler for the Atari ST has 16 bit ints and a limit on because the Sozobon C compiler for the Atari ST has 16 bit ints and a limit on
+3 -2
View File
@@ -53,7 +53,7 @@ code directly so the keys are not made a `-D` at the compiler.
You will be A-mazed. You will be A-mazed.
You are invited to try to cheat, ... if you can figure out how! :-) You are invited to try to cheat ... if you can figure out how! :-)
## Author's remarks: ## Author's remarks:
@@ -90,7 +90,8 @@ so make sure to convert tabs to spaces before using it.
Usage: Usage:
``` <!---sh--> ``` <!---sh-->
./buzzard [filename [escape-char [start-x start-yNNN ./buzzard [filename [escape-char \
[start-x start-yNNN
``` ```
Filename is the name of the file containing the maze. This Filename is the name of the file containing the maze. This
+3 -2
View File
@@ -423,7 +423,7 @@ code directly so the keys are not made a <code>-D</code> at the compiler.</p>
<pre><code> ./buzzard.alt</code></pre> <pre><code> ./buzzard.alt</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2> <h2 id="judges-remarks">Judges’ remarks:</h2>
<p>You will be A-mazed.</p> <p>You will be A-mazed.</p>
<p>You are invited to try to cheat, … if you can figure out how! :-)</p> <p>You are invited to try to cheat … if you can figure out how! :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2> <h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="how-to-play">How to play</h3> <h3 id="how-to-play">How to play</h3>
<p>When the game starts, you are at the far end of the maze from the exit, looking <p>When the game starts, you are at the far end of the maze from the exit, looking
@@ -447,7 +447,8 @@ separate physical rows in the maze; a space indicates a corridor,
and any other character is a wall. Tabs are also considered walls, and any other character is a wall. Tabs are also considered walls,
so make sure to convert tabs to spaces before using it.</p> so make sure to convert tabs to spaces before using it.</p>
<p>Usage:</p> <p>Usage:</p>
<pre><code> ./buzzard [filename [escape-char [start-x start-yNNN</code></pre> <pre><code> ./buzzard [filename [escape-char \
[start-x start-yNNN</code></pre>
<p>Filename is the name of the file containing the maze. This <p>Filename is the name of the file containing the maze. This
defaults to <code>buzzard.c</code> or rather <code>__FILE__</code>.</p> defaults to <code>buzzard.c</code> or rather <code>__FILE__</code>.</p>
<p>Escape-char is the character in the maze that represents the exit. <p>Escape-char is the character in the maze that represents the exit.
+1 -1
View File
@@ -53,7 +53,7 @@ of the DDS-BASIC interpreter. The program needs an executable C compiler called
### Program commands: ### Program commands:
- variable names `A` to `Z` - variable names A to Z
- FOR var = exp TO exp - FOR var = exp TO exp
- GOSUB exp - GOSUB exp
- GOTO exp - GOTO exp
+1 -1
View File
@@ -427,7 +427,7 @@ of the DDS-BASIC interpreter. The program needs an executable C compiler called
<code>cc</code> in your path in order to work.</p> <code>cc</code> in your path in order to work.</p>
<h3 id="program-commands">Program commands:</h3> <h3 id="program-commands">Program commands:</h3>
<ul> <ul>
<li>variable names <code>A</code> to <code>Z</code></li> <li>variable names A to Z</li>
<li>FOR var = exp TO exp</li> <li>FOR var = exp TO exp</li>
<li>GOSUB exp</li> <li>GOSUB exp</li>
<li>GOTO exp</li> <li>GOTO exp</li>
+8
View File
@@ -49,6 +49,14 @@
"display_via_github" : true, "display_via_github" : true,
"entry_text" : "original source code" "entry_text" : "original source code"
}, },
{
"file_path" : "map-key.jpg",
"inventory_order" : 60,
"OK_to_edit" : false,
"display_as" : "image",
"display_via_github" : false,
"entry_text" : "key to map image"
},
{ {
"file_path" : "1991_rince.tar.bz2", "file_path" : "1991_rince.tar.bz2",
"inventory_order" : 1415926535, "inventory_order" : 1415926535,
+5 -20
View File
@@ -80,27 +80,12 @@ enjoyment high.
### Instructions: ### Instructions:
Key to map: **Key to map**:
<img src="map-key.jpg"
alt="map to key"
width=800 height=400>
```
|
###### | | | /\ /--\ ==| /\ | | Directonal keys
###### Solid Wall | ----|| \/ /\ ||---- (unlock doors of
###### | \/ ==| \--/ \/ the same direction)
|
| << >> Doors. Unlocked by
Blank space | << vvvvvv ^^^^^^ >> the above keys.
| << >>
|
___ | o__O\ O__O ^__^ /O__o\
/ \ 'Crushable' | \___/ /----\ /----\ \___/ The four sprites for
\___/ boulder | _/_\ _/ \_ _/ \_ /_\_ your character :-)
|
___ uncrushable | /\ Diamonds. They can either be found lying
/@@@\ boulder | < > around (if only!) or manufacture by pushing
\@@@/ | \/ two 'crushable' rocks together.
|
```
The general idea of the game is to collect all the diamonds. This must The general idea of the game is to collect all the diamonds. This must
be done in the minimum amount of moves. I've allowed a margin of 5 be done in the minimum amount of moves. I've allowed a margin of 5
+5 -18
View File
@@ -441,24 +441,10 @@ it to see the rest of it .. :-) .) The general idea was to try and
write the smallest playable game, but keep the playability and write the smallest playable game, but keep the playability and
enjoyment high.</p> enjoyment high.</p>
<h3 id="instructions">Instructions:</h3> <h3 id="instructions">Instructions:</h3>
<p>Key to map:</p> <p><strong>Key to map</strong>:</p>
<pre><code> | <p><img src="map-key.jpg"
###### | | | /\ /--\ ==| /\ | | Directonal keys alt="map to key"
###### Solid Wall | ----|| \/ /\ ||---- (unlock doors of width=800 height=400></p>
###### | \/ ==| \--/ \/ the same direction)
|
| &lt;&lt; &gt;&gt; Doors. Unlocked by
Blank space | &lt;&lt; vvvvvv ^^^^^^ &gt;&gt; the above keys.
| &lt;&lt; &gt;&gt;
|
___ | o__O\ O__O ^__^ /O__o\
/ \ &#39;Crushable&#39; | \___/ /----\ /----\ \___/ The four sprites for
\___/ boulder | _/_\ _/ \_ _/ \_ /_\_ your character :-)
|
___ uncrushable | /\ Diamonds. They can either be found lying
/@@@\ boulder | &lt; &gt; around (if only!) or manufacture by pushing
\@@@/ | \/ two &#39;crushable&#39; rocks together.
|</code></pre>
<p>The general idea of the game is to collect all the diamonds. This must <p>The general idea of the game is to collect all the diamonds. This must
be done in the minimum amount of moves. I’ve allowed a margin of 5 be done in the minimum amount of moves. I’ve allowed a margin of 5
moves which brings the moves allowed to <code>484</code> (alter the value of <code>u</code> in moves which brings the moves allowed to <code>484</code> (alter the value of <code>u</code> in
@@ -500,6 +486,7 @@ Take care that it’s facing in the correct direction.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.alt2.c">rince.alt2.c</a> - second alternate source code</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.alt2.c">rince.alt2.c</a> - second alternate source code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.alt.c">rince.alt.c</a> - alternate source code</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.alt.c">rince.alt.c</a> - alternate source code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.orig.c">rince.orig.c</a> - original source code</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.orig.c">rince.orig.c</a> - original source code</li>
<li><a href="map-key.jpg">map-key.jpg</a> - key to map image</li>
</ul> </ul>
<h2 id="secondary-files">Secondary files</h2> <h2 id="secondary-files">Secondary files</h2>
<ul> <ul>
Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

+12 -39
View File
@@ -56,7 +56,7 @@ game:
``` <!---sh--> ``` <!---sh-->
make ttt make ttt
./ttt [first_move] # <- omit first arg to have it move first ./ttt [first_move]
./ttt next_move ./ttt next_move
``` ```
@@ -65,8 +65,12 @@ The shell script determines when the game is over, and automatically replaces
loss). The [ttt](%%REPO_URL%%/1991/westley/ttt.sh) script has two other modes: loss). The [ttt](%%REPO_URL%%/1991/westley/ttt.sh) script has two other modes:
``` <!---sh--> ``` <!---sh-->
./ttt quitgame # cancel any game in progress, revert to merlyn.c # cancel any game in progress,
./ttt clobber # remove all game files, revert to original source # revert to merlyn.c:
./ttt quitgame
# remove all game files,
# revert to original source:
./ttt clobber
``` ```
For example here is a potentially losing game: For example here is a potentially losing game:
@@ -77,42 +81,10 @@ For example here is a potentially losing game:
./ttt 6 ./ttt 6
``` ```
The final might look like: To see what it might look like, try it out.
The script redirects stderr to `/dev/null` by default. If you need errors or
``` <!---c--> warnings use `-e`.
a(X){/*/X=- a(X){/*/X=-
X -1;F;X=- -1;F;X=-
-1;F;}/*/ -1;F;}/*/
char z[][100]={"char z[][100]={","a(X){/*/X=-","-1;F;X=-","-1;F;}/*/","1999999999 :-) ",
"int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*",
"z[i=1]=n+97;i<4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z",
"[R];for(q&&Q;*r;)P(*r++);q&&(Q,P(44));}M(m){P(9);i-2||P(X&m?88:O&m?48:32);P(",
"9);}y(A){for(j=8;j;)~A&w[--j]||(q=0);}e(W,Z){for(i-=i*q;i<9&&q;)y(W|(1<<i++&",
"~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);",
"c(1);*J=--u?O?*J:*v[1]:53;X|=u<<57-*v[u];y(X);K=40+q;q?e(O,X),q&&(K='|'),e(X",
",O),R(),O|=1<<--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i<12;)s(i++),i>4&&N",
";s(q=12);P(48);P('}');P(59);N;q=0;L(1);for(i=5;i<13;)s(i++),N;L(2);}",0};
b(X){/*/X=- b(X){/*/X=-
X -1;F;X=- -1;F;X=- X
-1;F;}/*/ -1;F;}/*/
int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*
z[i=1]=n+97;i<4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z
[R];for(q&&Q;*r;)P(*r++);q&&(Q,P(44));}M(m){P(9);i-2||P(X&m?88:O&m?48:32);P(
9);}y(A){for(j=8;j;)~A&w[--j]||(q=0);}e(W,Z){for(i-=i*q;i<9&&q;)y(W|(1<<i++&
~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);
c(1);*J=--u?O?*J:*v[1]:53;X|=u<<57-*v[u];y(X);K=40+q;q?e(O,X),q&&(K='|'),e(X
,O),R(),O|=1<<--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i<12;)s(i++),i>4&&N
;s(q=12);P(48);P('}');P(59);N;q=0;L(1);for(i=5;i<13;)s(i++),N;L(2);}
c(X){/*/X=- c(X){/*/X=-
0 -1;F;X=- 0 -1;F;X=- 0
-1;F;}/*/ -1;F;}/*/
ttt: I win!
```
Redirects stderr to `/dev/null` by default. If you need errors or warnings use
`-e`.
## Alternate code: ## Alternate code:
@@ -233,7 +205,8 @@ e.g. the template:
``` ```
. . . . . .
O , O (this is the value 40; 2^3+2^5) O , O (this is the value 40; 2^3+2^5)
. . . ("O"s are 1 bits, "." and "," are 0 bits) . . . ("O"s are 1 bits,
"." and "," are 0 bits)
``` ```
...will make the `e()` function return a center move, as this is the only move ...will make the `e()` function return a center move, as this is the only move
+12 -35
View File
@@ -427,48 +427,24 @@ next move, recompile <code>nextmove.c</code> and play it again:</p>
<p>We have provided the shell script, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/ttt.sh">ttt.sh</a>, to make it easier to play the <p>We have provided the shell script, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/ttt.sh">ttt.sh</a>, to make it easier to play the
game:</p> game:</p>
<pre><code> make ttt <pre><code> make ttt
./ttt [first_move] # &lt;- omit first arg to have it move first ./ttt [first_move]
./ttt next_move</code></pre> ./ttt next_move</code></pre>
<p>The shell script determines when the game is over, and automatically replaces <p>The shell script determines when the game is over, and automatically replaces
<code>merlyn.c</code> (copied from <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.c">westley.c</a> with an improved version after a <code>merlyn.c</code> (copied from <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.c">westley.c</a> with an improved version after a
loss). The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/ttt.sh">ttt</a> script has two other modes:</p> loss). The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/ttt.sh">ttt</a> script has two other modes:</p>
<pre><code> ./ttt quitgame # cancel any game in progress, revert to merlyn.c <pre><code> # cancel any game in progress,
./ttt clobber # remove all game files, revert to original source</code></pre> # revert to merlyn.c:
./ttt quitgame
# remove all game files,
# revert to original source:
./ttt clobber</code></pre>
<p>For example here is a potentially losing game:</p> <p>For example here is a potentially losing game:</p>
<pre><code> ./ttt 1 <pre><code> ./ttt 1
./ttt 4 ./ttt 4
./ttt 6</code></pre> ./ttt 6</code></pre>
<p>The final might look like:</p> <p>To see what it might look like, try it out.</p>
<pre><code> a(X){/*/X=- a(X){/*/X=- <p>The script redirects stderr to <code>/dev/null</code> by default. If you need errors or
X -1;F;X=- -1;F;X=- warnings use <code>-e</code>.</p>
-1;F;}/*/ -1;F;}/*/
char z[][100]={&quot;char z[][100]={&quot;,&quot;a(X){/*/X=-&quot;,&quot;-1;F;X=-&quot;,&quot;-1;F;}/*/&quot;,&quot;1999999999 :-) &quot;,
&quot;int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*&quot;,
&quot;z[i=1]=n+97;i&lt;4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z&quot;,
&quot;[R];for(q&amp;&amp;Q;*r;)P(*r++);q&amp;&amp;(Q,P(44));}M(m){P(9);i-2||P(X&amp;m?88:O&amp;m?48:32);P(&quot;,
&quot;9);}y(A){for(j=8;j;)~A&amp;w[--j]||(q=0);}e(W,Z){for(i-=i*q;i&lt;9&amp;&amp;q;)y(W|(1&lt;&lt;i++&amp;&quot;,
&quot;~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);&quot;,
&quot;c(1);*J=--u?O?*J:*v[1]:53;X|=u&lt;&lt;57-*v[u];y(X);K=40+q;q?e(O,X),q&amp;&amp;(K=&#39;|&#39;),e(X&quot;,
&quot;,O),R(),O|=1&lt;&lt;--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i&lt;12;)s(i++),i&gt;4&amp;&amp;N&quot;,
&quot;;s(q=12);P(48);P(&#39;}&#39;);P(59);N;q=0;L(1);for(i=5;i&lt;13;)s(i++),N;L(2);}&quot;,0};
b(X){/*/X=- b(X){/*/X=-
X -1;F;X=- -1;F;X=- X
-1;F;}/*/ -1;F;}/*/
int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*
z[i=1]=n+97;i&lt;4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z
[R];for(q&amp;&amp;Q;*r;)P(*r++);q&amp;&amp;(Q,P(44));}M(m){P(9);i-2||P(X&amp;m?88:O&amp;m?48:32);P(
9);}y(A){for(j=8;j;)~A&amp;w[--j]||(q=0);}e(W,Z){for(i-=i*q;i&lt;9&amp;&amp;q;)y(W|(1&lt;&lt;i++&amp;
~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);
c(1);*J=--u?O?*J:*v[1]:53;X|=u&lt;&lt;57-*v[u];y(X);K=40+q;q?e(O,X),q&amp;&amp;(K=&#39;|&#39;),e(X
,O),R(),O|=1&lt;&lt;--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i&lt;12;)s(i++),i&gt;4&amp;&amp;N
;s(q=12);P(48);P(&#39;}&#39;);P(59);N;q=0;L(1);for(i=5;i&lt;13;)s(i++),N;L(2);}
c(X){/*/X=- c(X){/*/X=-
0 -1;F;X=- 0 -1;F;X=- 0
-1;F;}/*/ -1;F;}/*/
ttt: I win!</code></pre>
<p>Redirects stderr to <code>/dev/null</code> by default. If you need errors or warnings use
<code>-e</code>.</p>
<h2 id="alternate-code">Alternate code:</h2> <h2 id="alternate-code">Alternate code:</h2>
<p>This version is based on the author’s remarks. It is not supposed to lose but it <p>This version is based on the author’s remarks. It is not supposed to lose but it
can lose if you cheat. That’s supposed to happen. Can you win any other time?</p> can lose if you cheat. That’s supposed to happen. Can you win any other time?</p>
@@ -546,7 +522,8 @@ possible moves by making the <code>e()</code> function return “winning” move
e.g. the template:</p> e.g. the template:</p>
<pre><code> . . . <pre><code> . . .
O , O (this is the value 40; 2^3+2^5) O , O (this is the value 40; 2^3+2^5)
. . . (&quot;O&quot;s are 1 bits, &quot;.&quot; and &quot;,&quot; are 0 bits)</code></pre> . . . (&quot;O&quot;s are 1 bits,
&quot;.&quot; and &quot;,&quot; are 0 bits)</code></pre>
<p>…will make the <code>e()</code> function return a center move, as this is the only move <p>…will make the <code>e()</code> function return a center move, as this is the only move
that produces three in a row. Notice that the computer does not consider which that produces three in a row. Notice that the computer does not consider which
cells contain <code>X</code>s and <code>O</code>s when making a template move, only which cells are cells contain <code>X</code>s and <code>O</code>s when making a template move, only which cells are
+3 -1
View File
@@ -71,7 +71,9 @@ significant to only eight characters like `chars1`.
### Example 1: matches `^abc$` ### Example 1: matches `^abc$`
``` ```
<q0> a <q1> The first state to appear is the start state <q0> a <q1> The first state to
appear is the
start state
<q1> b <q2> <q1> b <q2>
<q2> c [q3] <q2> c [q3]
[q3] [q3]
+3 -1
View File
@@ -437,7 +437,9 @@ should have a similar specification somewhere. A state is accepting if
it is specified in square brackets: <code>[final]</code>; state strings are it is specified in square brackets: <code>[final]</code>; state strings are
significant to only eight characters like <code>chars1</code>.</p> significant to only eight characters like <code>chars1</code>.</p>
<h3 id="example-1-matches-abc">Example 1: matches <code>^abc$</code></h3> <h3 id="example-1-matches-abc">Example 1: matches <code>^abc$</code></h3>
<pre><code> &lt;q0&gt; a &lt;q1&gt; The first state to appear is the start state <pre><code> &lt;q0&gt; a &lt;q1&gt; The first state to
appear is the
start state
&lt;q1&gt; b &lt;q2&gt; &lt;q1&gt; b &lt;q2&gt;
&lt;q2&gt; c [q3] &lt;q2&gt; c [q3]
[q3]</code></pre> [q3]</code></pre>
+6 -6
View File
@@ -224,12 +224,12 @@ This is more obscured by factoring out common terms and restricting
ourselves to two operand operations: ourselves to two operand operations:
``` <!---c--> ``` <!---c-->
temp = z; (temp == z) temp = z; (temp == z)
temp -= y; (temp == z-y) temp -= y; (temp == z-y)
temp *= x; (temp == (z-y)*x) temp *= x; (temp == (z-y)*x)
y += temp; (y == (z-y)*x + y) y += temp; (y == (z-y)*x + y)
( == z*x - y*x + y) ( == z*x - y*x + y)
( == z*x + y*(1-x)) ( == z*x + y*(1-x))
``` ```
Next we imagine we have a [pc](https://en.wikipedia.org/wiki/Program_counter). Next we imagine we have a [pc](https://en.wikipedia.org/wiki/Program_counter).
+6 -6
View File
@@ -549,12 +549,12 @@ simply compute:</p>
<pre><code> y = (z * x) + (y * (1-x));</code></pre> <pre><code> y = (z * x) + (y * (1-x));</code></pre>
<p>This is more obscured by factoring out common terms and restricting <p>This is more obscured by factoring out common terms and restricting
ourselves to two operand operations:</p> ourselves to two operand operations:</p>
<pre><code> temp = z; (temp == z) <pre><code> temp = z; (temp == z)
temp -= y; (temp == z-y) temp -= y; (temp == z-y)
temp *= x; (temp == (z-y)*x) temp *= x; (temp == (z-y)*x)
y += temp; (y == (z-y)*x + y) y += temp; (y == (z-y)*x + y)
( == z*x - y*x + y) ( == z*x - y*x + y)
( == z*x + y*(1-x))</code></pre> ( == z*x + y*(1-x))</code></pre>
<p>Next we imagine we have a <a href="https://en.wikipedia.org/wiki/Program_counter">pc</a>. <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 “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 we’re not currently coming up on statement pc. To handle this, we simply make
+3
View File
@@ -1579,6 +1579,9 @@ added a newline at the end of the screen to be more user friendly.</p>
remove the maximum number of moves you may make and another to let you configure remove the maximum number of moves you may make and another to let you configure
the maximum number of moves, even if that is making it harder to win. Naturally the maximum number of moves, even if that is making it harder to win. Naturally
the above fix was applied to these versions too.</p> the above fix was applied to these versions too.</p>
<p>The file <code>map-key.jpg</code> was added to help those with smaller screens as
unfortunately the formatting of the key to the map was not easy to change in a
way without ruining how it looks (beyond making it one column only).</p>
<div id="1991_westley"> <div id="1991_westley">
<h2 id="winning-entry-1991westley">Winning entry: <a href="1991/westley/index.html">1991/westley</a></h2> <h2 id="winning-entry-1991westley">Winning entry: <a href="1991/westley/index.html">1991/westley</a></h2>
<h3 id="winning-entry-source-code-westley.c-4">Winning entry source code: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.c">westley.c</a></h3> <h3 id="winning-entry-source-code-westley.c-4">Winning entry source code: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.c">westley.c</a></h3>
+4
View File
@@ -1713,6 +1713,10 @@ remove the maximum number of moves you may make and another to let you configure
the maximum number of moves, even if that is making it harder to win. Naturally the maximum number of moves, even if that is making it harder to win. Naturally
the above fix was applied to these versions too. the above fix was applied to these versions too.
The file `map-key.jpg` was added to help those with smaller screens as
unfortunately the formatting of the key to the map was not easy to change in a
way without ruining how it looks (beyond making it one column only).
<div id="1991_westley"> <div id="1991_westley">
## Winning entry: [1991/westley](1991/westley/index.html) ## Winning entry: [1991/westley](1991/westley/index.html)
+1
View File
@@ -657,6 +657,7 @@
1991,rince,rince.alt2.c,40,true,c,true,second alternate source code 1991,rince,rince.alt2.c,40,true,c,true,second alternate source code
1991,rince,rince.alt.c,40,true,c,true,alternate source code 1991,rince,rince.alt.c,40,true,c,true,alternate source code
1991,rince,rince.orig.c,50,true,c,true,original source code 1991,rince,rince.orig.c,50,true,c,true,original source code
1991,rince,map-key.jpg,60,false,image,false,key to map image
1991,rince,1991_rince.tar.bz2,1415926535,false,tbz2,false,download entry tarball 1991,rince,1991_rince.tar.bz2,1415926535,false,tbz2,false,download entry tarball
1991,rince,README.md,4000000000,true,markdown,true,markdown source for this web page 1991,rince,README.md,4000000000,true,markdown,true,markdown source for this web page
1991,rince,.entry.json,4000000000,true,json,true,entry summary and manifest in JSON 1991,rince,.entry.json,4000000000,true,json,true,entry summary and manifest in JSON
1 # year dir file_path inventory_order OK_to_edit display_as display_via_github entry_text
657 1991 rince rince.alt2.c 40 true c true second alternate source code
658 1991 rince rince.alt.c 40 true c true alternate source code
659 1991 rince rince.orig.c 50 true c true original source code
660 1991 rince map-key.jpg 60 false image false key to map image
661 1991 rince 1991_rince.tar.bz2 1415926535 false tbz2 false download entry tarball
662 1991 rince README.md 4000000000 true markdown true markdown source for this web page
663 1991 rince .entry.json 4000000000 true json true entry summary and manifest in JSON
Binary file not shown.
+1
View File
@@ -233,6 +233,7 @@
1991/rince/.path 1991/rince/.path
1991/rince/1991_rince.tar.bz2 1991/rince/1991_rince.tar.bz2
1991/rince/index.html 1991/rince/index.html
1991/rince/map-key.jpg
1991/westley/.path 1991/westley/.path
1991/westley/1991_westley.tar.bz2 1991/westley/1991_westley.tar.bz2
1991/westley/index.html 1991/westley/index.html
+1
View File
@@ -658,6 +658,7 @@
1991/rince/Makefile 1991/rince/Makefile
1991/rince/README.md 1991/rince/README.md
1991/rince/index.html 1991/rince/index.html
1991/rince/map-key.jpg
1991/rince/rince.alt.c 1991/rince/rince.alt.c
1991/rince/rince.alt2.c 1991/rince/rince.alt2.c
1991/rince/rince.c 1991/rince/rince.c
+1
View File
@@ -658,6 +658,7 @@
1991/rince/Makefile 1991/rince/Makefile
1991/rince/README.md 1991/rince/README.md
1991/rince/index.html 1991/rince/index.html
1991/rince/map-key.jpg
1991/rince/rince.alt.c 1991/rince/rince.alt.c
1991/rince/rince.alt2.c 1991/rince/rince.alt2.c
1991/rince/rince.c 1991/rince/rince.c