Update 1992/kivinen

When I started the program I noticed that it ends very quickly. Yusuke
Endoh provided a patch that calls usleep(). I felt that this was too
slow so I added a macro at the Makefile, Z, default 15000, so one can
reconfigure it. Thank you Yusuke!

I also noticed that when starting the game it moves towards the right
and then exits. Yusuke pointed out that if you click the mouse it moves
back towards the centre. I added this to the bugs.md file. Thank you
Yusuke!

Fixed formatting of README.md file.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-09 11:44:43 -07:00
1 parent ec1862c2e2
commit e41586bcdd
4 files changed
+69 -34

No files matched your search

+1 -1
View File
@@ -58,7 +58,7 @@ ARCH=
# Defines that are needed to compile # Defines that are needed to compile
# #
CDEFINE= CDEFINE= -DZ=15000
# Include files that are needed to compile # Include files that are needed to compile
# #
+61 -32
View File
@@ -1,24 +1,52 @@
# Best X Program: # Best X Program:
Tero Kivinen Tero Kivinen
Helsinki University of Technology Helsinki University of Technology
Klovinrinne 6b Klovinrinne 6b
02180 Espoo 02180 Espoo
Finland Finland
## To build: ## To build:
If your machine support the X Window System, Version 11: If your machine support the X Window System, Version 11:
make all ```sh
make all
```
NOTE: this entry requires `X11/Xlib.h` header file and the X11 library to NOTE: this entry requires `X11/Xlib.h` header file and the X11 library to
compile. macOS users running Mountain Lion and later will need to download and compile. macOS users running Mountain Lion and later will need to download and
install [XQuartz](https://www.xquartz.org) in order to compile and run this install [XQuartz](https://www.xquartz.org) in order to compile and run this
entry. entry.
It was observed that on modern systems this goes much too quick. [Yusuke
Endoh](/winners.html#Yusuke_Endoh) created a patch that calls `usleep()` but
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) thought the value was
too slow so he made it a macro in the Makefile `Z`, defaulting at 15000. You can
reconfigure it like:
```sh
make clobber Z=1000 all
```
Yusuke also noted that there is a bug in the program where right after starting
it moves towards the right but if you click the mouse it goes back. Thank you
Yusuke!
## Try:
```sh
./kivinen
./kivinen a
./kivinen a b
```
See also the author's comments for other variations.
## Judges' comments: ## Judges' comments:
@@ -31,19 +59,19 @@ Such systems should compile using `-lX11`.
NOTE: The original winning source `kivinen.orig.c`, found in the archive NOTE: The original winning source `kivinen.orig.c`, found in the archive
directory, assumed that exit returned a value which cause problems for some directory, assumed that exit returned a value which cause problems for some
systems where exit returns void. The file kivinen.c avoids this problem. systems where exit returns void. The file [kivinen.c](kivinen.c) avoids this problem.
## Selected notes from the author: ## Selected notes from the author:
### X Entertainment Kit ### X Entertainment Kit:
This kit includes three games from the early of video games for This kit includes three games from the early of video games for
The X Window System Version 11 Release 5. It should work with The X Window System Version 11 Release 5. It should work with
earlier releases, though. earlier releases, though.
### Space Invaders #### Space Invaders
The classic game of shooting aliens from outer space, trying to The classic game of shooting aliens from outer space, trying to
exterminate all life on earth. The game ends when the first line exterminate all life on earth. The game ends when the first line
@@ -51,50 +79,51 @@ of aliens touches the ground, or destroy you. To win the game you
must destroy all the aliens. If you evade out from the screen you must destroy all the aliens. If you evade out from the screen you
lose. lose.
#### Controls: ##### Controls:
Button 1 = Move left - Button 1 = Move left
Button 2 = Fire missile - Button 2 = Fire missile
Button 3 = Move right - Button 3 = Move right
### Breakout: #### Breakout
Break all the bricks with the ball, using your paddle. If you miss Break all the bricks with the ball, using your paddle. If you miss
the ball the game ends. the ball the game ends.
#### Controls: ##### Controls:
Button 1 = Move left - Button 1 = Move left
Button 3 = Move right - Button 3 = Move right
### Dropout: #### Dropout
Catch all the falling pieces, before they reach the ground. If you Catch all the falling pieces, before they reach the ground. If you
miss it, game ends. To win you must catch all 30 pieces. miss it, game ends. To win you must catch all 30 pieces.
#### Controls: ##### Controls:
Button 1 = Move left - Button 1 = Move left
Button 3 = Move right - Button 3 = Move right
### Starting the game: ### Starting a game:
The type of the game is determined by the number of arguments The type of the game is determined by the number of arguments
given to the program. given to the program.
no arguments = Space Invaders - no arguments = Space Invaders
1 argument = Breakout - 1 argument = Breakout
2 arguments = Dropout - 2 arguments = Dropout
3 arguments = double sized Breakout - 3 arguments = double sized Breakout
4 arguments = triple sized Space Invaders - 4 arguments = triple sized Space Invaders
5 arguments = triple sized Breakout - 5 arguments = triple sized Breakout
6 arguments = double sized Dropout - 6 arguments = double sized Dropout
7 arguments = quadruple sized Breakout - 7 arguments = quadruple sized Breakout
and so on...
...and so on...
### Scores: ### Scores:
+1 -1
View File
@@ -36,4 +36,4 @@
XUnmapWindow (d,s[w]) ,s[w]=0,c--: XUnmapWindow (d,s[w]) ,s[w]=0,c--:
0,l=1; if(!x&&l)j= -j,l=0; if(l&x&&!v 0,l=1; if(!x&&l)j= -j,l=0; if(l&x&&!v
)u=~19,c--,l=0;t=(!x||!v) &&(y<5&&t<0||y>95&&t>0)?0 )u=~19,c--,l=0;t=(!x||!v) &&(y<5&&t<0||y>95&&t>0)?0
:t;s[1]?X(1,y+=x&v?t:t/(x+1),130):ext(++c);};return(c);} :t;s[1]?X(1,y+=x&v?t:t/(x+1),130):ext(++c);usleep(Z);};return(c);}
+6
View File
@@ -504,6 +504,12 @@ This program crashes. This will be worked on in the near future.
This entry will crash without enough args (2). At this time this is not This entry will crash without enough args (2). At this time this is not
considered a bug to fix so it should not be fixed. considered a bug to fix so it should not be fixed.
## [1992/kivinen](1992/kivinen/kivinen.c) ([README.md](1992/kivinen/README.md))
## STATUS: known bug - please help us fix
When you start the program everything starts to move over to the right side and then ends.
[Yusuke Endoh](/winners.html#Yusuke_Endoh) pointed out that if you click the
mouse it takes it back towards the centre but this should probably be fixed.
## [1992/lush](1992/lush/lush.c) ([README.md](1992/lush/README.md)) ## [1992/lush](1992/lush/lush.c) ([README.md](1992/lush/README.md))