Some fixes in 1993/rince
It was stated, perhaps even by me but no longer sure of this (it looks like my style) that after the program is terminated the terminal might not be sane and one could do 'stty sane', 'reset' and other things. Instead I have changed the code to just call endwin() and removed that information instead. This way the user should not be burdened by it. The alt code that I had added earlier on also has this fix. The markdown files have not been completely checked but both README.md and design.md have had some fixes applied. The thanks file also points out that Yusuke's fix applies the suggested fix for select(2) found in the README.md.
This commit is contained in:
1 parent
7f90bed520
commit
a28bd67968
5 files changed
+19
-12
No files matched your search
+12
-7
@@ -5,7 +5,7 @@ make all
|
||||
```
|
||||
|
||||
NOTE: there is an alternate version of this program that allows one to slow down
|
||||
the game. See the Alternate code section below.
|
||||
the game. See the [Alternate code](#alternate-code) section below.
|
||||
|
||||
|
||||
## To use:
|
||||
@@ -18,7 +18,8 @@ where:
|
||||
|
||||
`[cabbage]` is a CABBAGE description file (default: `rince.c`)
|
||||
|
||||
## Alternate code: slowing down the game
|
||||
|
||||
## Alternate code
|
||||
|
||||
Some people may want to slow down the game by increasing the
|
||||
value 17 in the lines:
|
||||
@@ -34,7 +35,10 @@ and
|
||||
refresh(),c=select(k,&y,0,0,(v.tv_usec=1<<17,&v))?getch():0;
|
||||
```
|
||||
|
||||
to another value like 18 or 19. You can do this via the alternate code like:
|
||||
to another value like 18 or 19 which you can do with the alternate code.
|
||||
|
||||
|
||||
### Alternate build:
|
||||
|
||||
|
||||
```sh
|
||||
@@ -43,6 +47,9 @@ make CDEFINE="-DZ=18" clobber alt
|
||||
|
||||
Replace 18 with whatever number you wish.
|
||||
|
||||
|
||||
### Alternate use:
|
||||
|
||||
Use `rince.alt` as you would `rince` above.
|
||||
|
||||
|
||||
@@ -97,6 +104,7 @@ select(k,&y,0,0,(v.tv_usec=1<<whatever_you_want,&v))
|
||||
|
||||
where `whatever_you_want` is some integer such as 17 or 19.
|
||||
|
||||
|
||||
### WARNING for SunOS 4.1.x:
|
||||
|
||||
If you are running SunOS 4.1.x (assuming you can find an ANSI
|
||||
@@ -106,12 +114,9 @@ with it.
|
||||
|
||||
### Additional notes
|
||||
|
||||
One may also need to do a `stty sane` if you kill the program
|
||||
to restore your terminal state. If that does not work try `reset`.
|
||||
|
||||
Some people report that `rince` dumps core on their system.
|
||||
|
||||
On some systems that use gcc, the curses.h used by gcc (typically
|
||||
On some systems that use gcc, the `curses.h` used by gcc (typically
|
||||
`/usr/local/include/curses.h` if not `/usr/include/curses.h`) is not compatible
|
||||
with the curses library (typically `/lib/libcurses.a` for static libraries)
|
||||
used. It has been suggested that the following gcc command may help:
|
||||
|
||||
@@ -10,13 +10,10 @@ For instance, assume you wish to make a boulder `o` roll off a hill `/`
|
||||
A standard automata would have 2 rules something like this:
|
||||
|
||||
```
|
||||
<pre>
|
||||
|
||||
o.. ...
|
||||
\.. --> 'o' .o. --> '.'
|
||||
... .\.
|
||||
|
||||
</pre>
|
||||
```
|
||||
|
||||
However, the system I devised, in order to keep things small and neat(!),
|
||||
@@ -27,7 +24,6 @@ Hence:
|
||||
.o. ...
|
||||
.\. --> .\o
|
||||
... ...
|
||||
|
||||
```
|
||||
|
||||
This does of course have the odd problem with clashes. What if we want to
|
||||
|
||||
@@ -120,4 +120,5 @@ int main(int open, U**exit) {
|
||||
t=(j*I*a(Q--,--Q)));
|
||||
t->y=J[Y][c]; J[Y][c]=t;
|
||||
fgets(t->x,20,C); }
|
||||
endwin();
|
||||
}
|
||||
@@ -120,4 +120,5 @@ int main(int open, U**exit) {
|
||||
t=(j*I*a(Q--,--Q)));
|
||||
t->y=J[Y][c]; J[Y][c]=t;
|
||||
fgets(t->x,20,C); }
|
||||
endwin();
|
||||
}
|
||||
+5
-1
@@ -1610,7 +1610,11 @@ also checks for two args. See the README.md files for details.
|
||||
|
||||
## [1993/rince](1993/rince/rince.c) ([README.md](1993/rince/README.md]))
|
||||
|
||||
Yusuke supplied a patch to get this to work in modern systems.
|
||||
Yusuke supplied a patch to get this to work in modern systems. This fix also
|
||||
applies the compatibility issue of `select(2)` described in the README.md file.
|
||||
|
||||
Cody added a call to `endwin()` to help with terminal sanity after the program
|
||||
ends.
|
||||
|
||||
Cody provided an alternate version to simplify slowing the game down. This was
|
||||
based on our suggestion that it might be desired to slow down but done in a way
|
||||
|
||||
Reference in new issue
Block a user