Update 2001/kev
Format fix README.md. The author noted some known issues. Marked them as INABIAF. In this case (first one) I found the author's mastodon handle. Added to winners.csv and the README.md. I was unable to test that the program still works. I might test it another time.
This commit is contained in:
1 parent
ce9162e878
commit
31a4242f8c
3 files changed
+67
-51
No files matched your search
+45
-50
@@ -1,12 +1,12 @@
|
|||||||
# Best Curses Game
|
# Best Curses Game
|
||||||
|
|
||||||
Kevin Pulo
|
Kevin Pulo
|
||||||
School of Information Technologies
|
School of Information Technologies
|
||||||
Madsen Building F09
|
Madsen Building F09
|
||||||
University of Sydney, NSW, 2006
|
University of Sydney, NSW, 2006
|
||||||
Australia
|
Australia
|
||||||
|
<http://www.kev.pulo.com.au/>
|
||||||
http://www.kev.pulo.com.au/
|
Mastodon: <https://fosstodon.org/@devkev>
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -38,12 +38,8 @@ box.
|
|||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
NETWORK P*NG!
|
|
||||||
[=================]
|
|
||||||
|
|
||||||
Kevin Pulo
|
|
||||||
kev@pulo.com.au
|
|
||||||
|
|
||||||
|
**NETWORK PONG!**
|
||||||
|
|
||||||
### REQUIREMENTS
|
### REQUIREMENTS
|
||||||
|
|
||||||
@@ -53,35 +49,34 @@ box.
|
|||||||
|
|
||||||
### DESCRIPTION
|
### DESCRIPTION
|
||||||
|
|
||||||
This program is a two-player networked version of the eighties
|
This program is a two-player networked version of the eighties arcade classic,
|
||||||
arcade classic, "pong". It uses standard TCP sockets to
|
[Pong](https://en.wikipedia.org/wiki/Pong). It uses standard TCP sockets to
|
||||||
communicate over the net, and ncurses for display. It supports
|
communicate over the net, and `ncurses` for display. It supports variable
|
||||||
variable terminal sizes (though both players must have the same
|
terminal sizes (though both players must have the same terminal size) and game
|
||||||
terminal size) and game speeds. Each player has a paddle to hit
|
speeds. Each player has a paddle to hit the ball, and you get points for
|
||||||
the ball, and you get points for getting the ball past your
|
getting the ball past your opponent's paddle. It's pretty fun! :)
|
||||||
opponent's paddle. It's pretty fun! :)
|
|
||||||
|
|
||||||
### RUNNING
|
### RUNNING
|
||||||
|
|
||||||
Run the server first without any command line arguments, ie.
|
Run the server first without any command line arguments, i.e.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./kev
|
./kev
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run the client with a single command line argument which is
|
Then run the client with a single command line argument which is
|
||||||
the name of the machine running the server, eg.
|
the name of the machine running the server, e.g.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./kev localhost
|
./kev localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure that the terminals on both ends are the same size.
|
Make sure that the terminals on both ends are the same size. Also, the TCP port
|
||||||
Also, the TCP port number specified in the build file mustn't be
|
number (5455) specified in the [Makefile](Makefile) mustn't be blocked by a
|
||||||
blocked by a firewall.
|
firewall.
|
||||||
|
|
||||||
Here's a good quick example to see it in action on your own
|
Here's a good quick example to see it in action on your own
|
||||||
machine, assuming you have Xwindows:
|
machine, assuming you have `Xwindows`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
|
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
|
||||||
@@ -91,9 +86,9 @@ xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
|
|||||||
### PLAYING
|
### PLAYING
|
||||||
|
|
||||||
Your paddle is the one at the bottom of the screen, your opponent
|
Your paddle is the one at the bottom of the screen, your opponent
|
||||||
is at the top. To move your paddle left, hold down ',' (ie. '<'
|
is at the top. To move your paddle left, hold down `,` (i.e. `<`
|
||||||
but don't press shift). To move your paddle right, hold down '.'.
|
but don't press shift). To move your paddle right, hold down `.`.
|
||||||
To quit, either player may press 'q'.
|
To quit, either player may press `q`.
|
||||||
|
|
||||||
The current score is shown on the left side of the halfway line.
|
The current score is shown on the left side of the halfway line.
|
||||||
Your score is the lower number, your opponents score is the upper
|
Your score is the lower number, your opponents score is the upper
|
||||||
@@ -110,10 +105,10 @@ will decrease (or if the ball is going slowly enough, it'll turn
|
|||||||
around).
|
around).
|
||||||
|
|
||||||
You might want to increase your keyboard repeat rate before
|
You might want to increase your keyboard repeat rate before
|
||||||
playing. On the Linux console try "kbdrate -r 24.0 -d 250"
|
playing. On the Linux console try `kbdrate -r 24.0 -d 250`
|
||||||
(kbdrate might be "hidden" from normal users in /sbin, and you
|
(`kbdrate` might be "hidden" from normal users in `/sbin`, and you
|
||||||
might need to be root anyway), in Xwindows try "xset r rate 250
|
might need to be root anyway), in `Xwindows` try `xset r rate 250
|
||||||
24" (find out your current rate first with "xset q", so that you
|
24` (find out your current rate first with `xset q`, so that you
|
||||||
can reset it later).
|
can reset it later).
|
||||||
|
|
||||||
Look below in the Building section for info on how to speed up or
|
Look below in the Building section for info on how to speed up or
|
||||||
@@ -122,23 +117,23 @@ terminal size).
|
|||||||
|
|
||||||
### BUILDING
|
### BUILDING
|
||||||
|
|
||||||
Just run the Makefile as above. The "SPEED" variable in the Makefile
|
Just run `make`to use the Makefile as above. The `SPEED` variable in the Makefile
|
||||||
controls the speed of the game (defaults to 50). This speed is
|
controls the speed of the game (defaults to `50`). This speed is
|
||||||
the delay between frames in milliseconds. Thus a value of 0 will
|
the delay between frames in milliseconds. Thus a value of 0 will
|
||||||
make the game go as fast as your network can handle, and values
|
make the game go as fast as your network can handle, and values
|
||||||
less than 50 are useful for larger terminals or more exciting
|
less than 50 are useful for larger terminals or more exciting
|
||||||
games. The program needs bandwidth equal to 1/s bytes per second
|
games. The program needs bandwidth equal to 1/s bytes per second
|
||||||
(where "s" is the speed value). Any latency on the network will
|
(where `s` is the speed value). Any latency on the network will
|
||||||
be added to s - so you should probably subtract any latency from
|
be added to `s` - so you should probably subtract any latency from
|
||||||
the value of s you want to have. Given that loopback and fast
|
the value of `s` you want to have. Given that `loopback` and fast
|
||||||
Ethernet LANs are both much less than 1ms of latency, you should
|
Ethernet LANs are both much less than 1ms of latency, you should
|
||||||
only need to worry about this if you plan on playing over a slower
|
only need to worry about this if you plan on playing over a slower
|
||||||
link like a cable modem, DSL, or (God-forbid) dialup.
|
link like a cable modem, DSL, or (God-forbid) dial-up.
|
||||||
|
|
||||||
The TCP port to use for network communications is specified by the
|
The TCP port to use for network communications is specified by the
|
||||||
"PORT" variable in the Makefile. If the default of 5455 is
|
`PORT` variable in the Makefile. If the default of `5455` is
|
||||||
blocked for whatever reason, you can change it to something else.
|
blocked for whatever reason, you can change it to something else.
|
||||||
Of course if you use a port < 1024, you'll need to be root.
|
Of course if you use a `port < 1024`, you'll need to be root.
|
||||||
|
|
||||||
### OBFUSCATION
|
### OBFUSCATION
|
||||||
|
|
||||||
@@ -159,22 +154,22 @@ unexpectedly cool. :)
|
|||||||
|
|
||||||
### BUGS
|
### BUGS
|
||||||
|
|
||||||
There are 3 warnings when I compile with gcc 2.95.3 (-Wall -ansi
|
There are 3 warnings when I compile with gcc 2.95.3 (`-Wall -ansi
|
||||||
-pedantic) on my Linux system, but all are completely harmless.
|
-pedantic`) on my Linux system, but all are completely harmless.
|
||||||
|
|
||||||
I don't like the curses and/or termcaps/terminfos on IRIX and
|
I don't like the curses and/or termcaps/terminfos on IRIX and
|
||||||
Solaris (the only two non-Linux systems I have access to).
|
Solaris (the only two non-Linux systems I have access to).
|
||||||
Despite calling timeout(0), notimeout(win, TRUE), nodelay(win,
|
Despite calling `timeout(0);`, `notimeout(win, TRUE);`, `nodelay(win,
|
||||||
TRUE) and/or keypad(win, FALSE), it still seems to force a delay
|
TRUE);` and/or `keypad(win, FALSE);`, it still seems to force a delay
|
||||||
into calls to getch() - I'm guessing at a termcap/terminfo level.
|
into calls to `getch()` - I'm guessing at a termcap/terminfo level.
|
||||||
At any rate, I can't seem to force no delay. This is a shame,
|
At any rate, I can't seem to force no delay. This is a shame,
|
||||||
because it basically plays havoc with the input code, particularly
|
because it basically plays havoc with the input code, particularly
|
||||||
the read-ahead canceller. It still works, but not nearly as well
|
the read-ahead canceller. It still works, but not nearly as well
|
||||||
(keypresses are dodgey and holding down keys doesn't always work),
|
(key presses are dodgy and holding down keys doesn't always work),
|
||||||
and so I _much_ prefer and recommend Linux libncurses.
|
and so I _much_ prefer and recommend Linux `libncurses`.
|
||||||
|
|
||||||
Sometimes when 'q' is pressed in one, the other will crash out
|
Sometimes when `q` is pressed in one, the other will crash out
|
||||||
with "Broken pipe".
|
with `Broken pipe`.
|
||||||
|
|
||||||
If the specified port can't be bound or connected to, the program
|
If the specified port can't be bound or connected to, the program
|
||||||
segfaults.
|
segfaults.
|
||||||
@@ -185,7 +180,7 @@ possible to crash the program a player scores over a billion
|
|||||||
points (1e9). Maybe you can consider that the goal... ;)
|
points (1e9). Maybe you can consider that the goal... ;)
|
||||||
|
|
||||||
If you run the client and server on different architectures, both
|
If you run the client and server on different architectures, both
|
||||||
architectures need to have the same character systems (ie. don't
|
architectures need to have the same character systems (i.e. don't
|
||||||
try mixing ASCII and EBCDIC). It is independent of endianness
|
try mixing ASCII and EBCDIC). It is independent of endianness
|
||||||
though.
|
though.
|
||||||
|
|
||||||
|
|||||||
@@ -1276,6 +1276,27 @@ Yes that's a zero. Now removing the 0 changes it to:
|
|||||||
I did break that line up too but I don't remember the results and unfortunately
|
I did break that line up too but I don't remember the results and unfortunately
|
||||||
right now I need to not continue with it. Still some ideas.
|
right now I need to not continue with it. Still some ideas.
|
||||||
|
|
||||||
|
## [2001/kev](2001/kev/kev.c) ([README.md](2001/kev/README.md)
|
||||||
|
## STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
|
||||||
|
Sometimes when one player presses `q` it will result in broken pipe on the other
|
||||||
|
end.
|
||||||
|
|
||||||
|
The author also noted that some versions of `curses` have problems with
|
||||||
|
`getch()` having a delay.
|
||||||
|
|
||||||
|
The program is very likely to segfault if the specified port can't be bound or
|
||||||
|
connected to.
|
||||||
|
|
||||||
|
If the terminal is too wide (the author suggests over 500 characters) the
|
||||||
|
program can segfault.
|
||||||
|
|
||||||
|
It's also possible to crash the program if a player scores over a billion
|
||||||
|
points.
|
||||||
|
|
||||||
|
Although it is independent of endianness both systems need the same character
|
||||||
|
set. In other words both have to be ASCII or EBCDIC - not one of each.
|
||||||
|
|
||||||
# 2002
|
# 2002
|
||||||
|
|
||||||
There was no IOCCC in 2002.
|
There was no IOCCC in 2002.
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ Joshua Karns,Joshua_Karns,null,null,jkarns275@gmail.com,null,@jkarnss);
|
|||||||
Jyrki Holopainen,Jyrki_Holopainen,https://web.archive.org/web/20061205082106/http://personal.eunet.fi/pp/halo/,null,jyrki.holopainen@paetronics.fi,null,null);
|
Jyrki Holopainen,Jyrki_Holopainen,https://web.archive.org/web/20061205082106/http://personal.eunet.fi/pp/halo/,null,jyrki.holopainen@paetronics.fi,null,null);
|
||||||
Karl F. Fox,Karl_F._Fox,null,null,karl@ascend.com,null,null);
|
Karl F. Fox,Karl_F._Fox,null,null,karl@ascend.com,null,null);
|
||||||
Ken Huffman,Ken_Huffman,http://www.huffmancoding.com,null,huffmancoding@gmail.com,null,null);
|
Ken Huffman,Ken_Huffman,http://www.huffmancoding.com,null,huffmancoding@gmail.com,null,null);
|
||||||
Kevin Pulo,Kevin_Pulo,//www.kev.pulo.com.au/,null,kev@pulo.com.au,null,null);
|
Kevin Pulo,Kevin_Pulo,//www.kev.pulo.com.au/,null,kev@pulo.com.au,null,@devkev@fosstodon.org);
|
||||||
Kimmo Fredriksson,Kimmo_Fredriksson,null,kimmo.k.k.fredriksson@gmail.com,null,null);
|
Kimmo Fredriksson,Kimmo_Fredriksson,null,kimmo.k.k.fredriksson@gmail.com,null,null);
|
||||||
Larry Jones,Larry_Jones,null,null,lawrence.jones@siemens.com,null,null);
|
Larry Jones,Larry_Jones,null,null,lawrence.jones@siemens.com,null,null);
|
||||||
Larry Wall,Larry_Wall,http://www.wall.org/~larry/,null,larry@wall.org,US,null);
|
Larry Wall,Larry_Wall,http://www.wall.org/~larry/,null,larry@wall.org,US,null);
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 23 and column 6.
|
Reference in new issue
Block a user