Make 2013/birken restore sanity after exit

As long as the program (alt code and otherwise) runs to completion the
program will return instead of 0:

    system("reset");

so that the terminal becomes sane again (otherwise cursor is invisible).
One could also use 'tput cvvis' but this is longer and I wanted to make
the column as close to the original ending as possible.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-14 04:50:29 -08:00
1 parent ef8c84a3b1
commit f954d8d4a5
6 files changed
+26 -15

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ CDEFINE= -DZ=15000
# Include files that are needed to compile
#
CINCLUDE=
CINCLUDE= -include stdlib.h
# Optimization
#
+12 -5
View File
@@ -42,9 +42,16 @@ perl -e 'map{map{print int(rand()*8);}(0..16);print chr(10);}(0..30);' | tr '[0-
./try.sh
```
If you wish to speed it up 200% you can use instead `-DZ=3750`. Doing this
you might find the right value to your liking; use ctrl-c to terminate the
program early.
If you wish to speed that up 200% you can use instead `-DZ=3750`. Doing this you
might find the right value to your liking; use ctrl-c to terminate the program
early but note that the terminal is likely to be messed up. Try:
```sh
reset
```
to make it sane again (running to completion will do that for you).
## Original code:
@@ -69,8 +76,8 @@ PLEASE be careful if you are sensitive to flashing colours!
## Judges' remarks:
This program also wins the "Most amusing abuse of the iocccsize tool" award; although not the
absolute best: it is possible to achieve 0 by writing:
This program also wins the "Most amusing abuse of the iocccsize tool" award;
although not the absolute best: it is possible to achieve 0 by writing:
```c
/* *\
+1 -1
View File
@@ -47,4 +47,4 @@ g[2][g[i][T]]=T; n(R+i)o(e,m )if(G[T][e]+i) G[T][e]=g[2][G[T][e]];
; else if(G[R][T]+i) s++; if(s) { if(V>4){ V=9-V; D++; } V+=29; n(20) q(c[V][T][0],c
[V][T][i],D); } } n(19) if((L=G[R][T])+i) { O=T-L; e=O>9; t=e?18-O :O; o(K,((t&3)-3?
16:37)){ if(K){ L=c[t+19][K-i][0]; O=c[t+19][K-i][i] ; } q(L,O,K && e); } } if(s) q(
c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return 0; }
c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return system("reset"); }
+1 -1
View File
@@ -46,4 +46,4 @@ g[2][g[i][T]]=T; n(R+i)o(e,m )if(G[T][e]+i) G[T][e]=g[2][G[T][e]];
; else if(G[R][T]+i) s++; if(s) { if(V>4){ V=9-V; D++; } V+=29; n(20) q(c[V][T][0],c
[V][T][i],D); } } n(19) if((L=G[R][T])+i) { O=T-L; e=O>9; t=e?18-O :O; o(K,((t&3)-3?
16:37)){ if(K){ L=c[t+19][K-i][0]; O=c[t+19][K-i][i] ; } q(L,O,K && e); } } if(s) q(
c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return 0; }
c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return system("reset");}
+1 -1
View File
@@ -18,7 +18,7 @@ if [[ -z "$BIRKEN" ]]; then
BIRKEN="birken.alt"
fi
trap "clear; exit" SIGINT
trap 'reset; exit' 0 1 2 3 15
for i in *.txt; do
NAME="$(echo "$i" | awk '{ print toupper(substr($1,1,1)) substr($1,2)}'|sed -e 's/\.txt//g' \