The new-style port for Paul Falstad's xminesweeper, here
my Xaw-only version.
This commit is contained in:
parent
2e2449e118
commit
36849aae92
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=618
6 changed files with 141 additions and 0 deletions
14
games/xmine/Makefile
Normal file
14
games/xmine/Makefile
Normal file
|
@ -0,0 +1,14 @@
|
|||
# New ports collection makefile for: xmine(1)
|
||||
# Version required: 1.0.3 / Athena
|
||||
# Date created: 25 December 1994
|
||||
# Whom: joerg
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
DISTNAME= xmine-1.0.3-Xaw
|
||||
USE_IMAKE= yes
|
||||
|
||||
DEPENDS= x11/Xaw3d
|
||||
|
||||
.include <bsd.port.mk>
|
57
games/xmine/files/patch-aa
Normal file
57
games/xmine/files/patch-aa
Normal file
|
@ -0,0 +1,57 @@
|
|||
*** xmine.c~ Sat Apr 2 00:20:15 1994
|
||||
--- xmine.c Thu Jun 30 10:20:34 1994
|
||||
***************
|
||||
*** 78,83 ****
|
||||
--- 78,90 ----
|
||||
#define GSPACEX 16
|
||||
#define GSPACEY 16
|
||||
|
||||
+ /* some systems might be better off with using "random()" instead of "rand()"*/
|
||||
+ #if defined __FreeBSD__
|
||||
+ # define USE_RANDOM 1
|
||||
+ #else
|
||||
+ # define USE_RANDOM 0
|
||||
+ #endif
|
||||
+
|
||||
#define SCORE_FILE "~/.xmine_scores"
|
||||
#define TOPMARGIN 60
|
||||
#define BOTMARGIN 12
|
||||
***************
|
||||
*** 911,922 ****
|
||||
--- 918,938 ----
|
||||
{
|
||||
int i, x, y, xd, yd, tries;
|
||||
|
||||
+ #if USE_RANDOM
|
||||
+ srandom((unsigned) time(0));
|
||||
+ #else
|
||||
srand((unsigned int) time(0));
|
||||
+ #endif
|
||||
for (i = 0; i != mine_count; i++) {
|
||||
tries = 1000;
|
||||
do {
|
||||
+ #if USE_RANDOM
|
||||
+ x = (random()>>1) % gsizex;
|
||||
+ y = (random()>>1) % gsizey;
|
||||
+ #else
|
||||
x = (rand()>>1) % gsizex;
|
||||
y = (rand()>>1) % gsizey;
|
||||
+ #endif
|
||||
tries--;
|
||||
} while (tries && (grid[x][y] ||
|
||||
!(x < fx-1 || x > fx+1 || y < fy-1
|
||||
*** Imakefile~ Mon Dec 26 12:42:58 1994
|
||||
--- Imakefile Mon Dec 26 12:49:44 1994
|
||||
***************
|
||||
*** 20,25 ****
|
||||
--- 20,29 ----
|
||||
# define WarnLevel
|
||||
#endif
|
||||
|
||||
+ # for FreeBSD package: do not compress man page, otherwise gzip will
|
||||
+ # complain when building the package target
|
||||
+ COMPRESSMANCMD = echo
|
||||
+
|
||||
DEPLIBS = XawClientDepLibs
|
||||
LOCAL_LIBRARIES = XawClientLibs
|
||||
EXTRA_DEFINES = WarnLevel Xaw3dDefs
|
15
games/xmine/files/patch-ab
Normal file
15
games/xmine/files/patch-ab
Normal file
|
@ -0,0 +1,15 @@
|
|||
*** Imakefile~ Mon Dec 26 12:50:19 1994
|
||||
--- Imakefile Mon Dec 26 12:53:45 1994
|
||||
***************
|
||||
*** 1,5 ****
|
||||
/* if you have Xaw3d installed, you might wish to use this: */
|
||||
! #define UseXaw3d 0
|
||||
|
||||
/* for debugging: */
|
||||
/* CDEBUGFLAGS = -g -O2 */
|
||||
--- 1,5 ----
|
||||
/* if you have Xaw3d installed, you might wish to use this: */
|
||||
! #define UseXaw3d YES
|
||||
|
||||
/* for debugging: */
|
||||
/* CDEBUGFLAGS = -g -O2 */
|
1
games/xmine/pkg-comment
Normal file
1
games/xmine/pkg-comment
Normal file
|
@ -0,0 +1 @@
|
|||
The `Athena' port of the xminesweeper game
|
50
games/xmine/pkg-descr
Normal file
50
games/xmine/pkg-descr
Normal file
|
@ -0,0 +1,50 @@
|
|||
xmine is an X11-based version of the popular PC game Minesweeper. The
|
||||
object is to place flags on mines on the game board without exposing
|
||||
them.
|
||||
|
||||
xmine is freely redistributable. It's mostly Xlib-based, but it
|
||||
requires Motif libraries for the menus.
|
||||
|
||||
Author: Paul Falstad (pf@z-code.com)
|
||||
===
|
||||
|
||||
This version of xmine is based on Paul Falstad's version 1.0.3, as
|
||||
published in comp.sources.x. It has been heavily munged to work
|
||||
without OSF/Motif.
|
||||
|
||||
Almost everything needed was already in the Athena Widget Set, with
|
||||
the exception of a Canvas Widget (or DrawingAreaWidget in Motif
|
||||
terms). Hence i have included a copy of the Canvas Widget of the Free
|
||||
Widget Foundation, only slightly modified to take the #include's from
|
||||
the current directory. If anybody is unlucky with the GPL conditions
|
||||
applying to the FWF code, she is free to drop in own versions of a
|
||||
Canvas Widget (really not much of code).
|
||||
|
||||
I originally intented to #ifdef Paul's version for use with the Athena
|
||||
Widget Set, but realized that this would have resulted in too much of
|
||||
spagghetti code. That's why i hacked a separate source out of it. I
|
||||
cleaned it up a bit, so it will compile now without complaints with
|
||||
the -Wall flag set under gcc.
|
||||
|
||||
Since the game itself has some 3D look, linking against the famous
|
||||
Xaw3d library is highly recommended.
|
||||
|
||||
|
||||
ACKNOWLEDGEMENTS:
|
||||
=================
|
||||
|
||||
For X11:
|
||||
The X Consortium, MIT, DEC, ...
|
||||
|
||||
For the original OSF/Motif version of xmine:
|
||||
Paul Falstad (pf@z-code.com)
|
||||
|
||||
For the three-D lookalike Athena Widget set:
|
||||
Kaleb S. Keithley (kaleb@jpl-devvax.jpl.nasa.gov)
|
||||
|
||||
For the Canvas Widget of the Free Widget Foundation:
|
||||
Robert H. Forsman Jr.
|
||||
|
||||
---
|
||||
enjoy,
|
||||
Joerg Wunsch <joerg_wunsch@uriah.sax.de>
|
4
games/xmine/pkg-plist
Normal file
4
games/xmine/pkg-plist
Normal file
|
@ -0,0 +1,4 @@
|
|||
@cwd /usr/X11R6
|
||||
bin/xmine
|
||||
lib/X11/app-defaults/Xmine
|
||||
man/man1/xmine.1
|
Loading…
Reference in a new issue