Fix code blocks in 1991 and part of 1992
In 1991 the code blocks in the html files should look better with smaller screens. In one entry, rince, an image was added as the formatting is too complicated to get right. The text was changed from two columns to one column and then a screenshot was taken so that it's a bit easier to see with smaller widths. This looks fairly good on mobile phones too. The only downside, of course, is if the web pages ever change to have a different background or code colour it won't match but it did not look right with mobile phones. This required a manifest update. In 1992 one entry's html file defeated me for now so I had to stop. This can be looked at later. The last entry I am committing changes to is 1991/buzzard.1. It was buzzard.2/buzzard.2.design.md that is a big problem and will have to be done another time.
This commit is contained in:
1 parent
1e2793bf5b
commit
3fdb24beb9
23 files changed
+119
-146
No files matched your search
+12
-39
@@ -56,7 +56,7 @@ game:
|
||||
|
||||
``` <!---sh-->
|
||||
make ttt
|
||||
./ttt [first_move] # <- omit first arg to have it move first
|
||||
./ttt [first_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:
|
||||
|
||||
``` <!---sh-->
|
||||
./ttt quitgame # cancel any game in progress, revert to merlyn.c
|
||||
./ttt clobber # remove all game files, revert to original source
|
||||
# cancel any game in progress,
|
||||
# revert to merlyn.c:
|
||||
./ttt quitgame
|
||||
# remove all game files,
|
||||
# revert to original source:
|
||||
./ttt clobber
|
||||
```
|
||||
|
||||
For example here is a potentially losing game:
|
||||
@@ -77,42 +81,10 @@ For example here is a potentially losing game:
|
||||
./ttt 6
|
||||
```
|
||||
|
||||
The final might look like:
|
||||
To see what it might look like, try it out.
|
||||
|
||||
|
||||
``` <!---c-->
|
||||
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`.
|
||||
The script redirects stderr to `/dev/null` by default. If you need errors or
|
||||
warnings use `-e`.
|
||||
|
||||
|
||||
## Alternate code:
|
||||
@@ -233,7 +205,8 @@ e.g. the template:
|
||||
```
|
||||
. . .
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user