Commit 4f47e848 authored by Markus Koschany's avatar Markus Koschany

New upstream version 1.0.1

parent 333e3c27
24 April 1999
Fixed build for Cygwin32 platform - thanks to Alan de Smet
<chaos@null.net>
22 July 1999
Changed strings.h to string.h , and added maintainer-clean to
Makefile.in - thanks to Antti-Juhani Kaijanaho <gaia@iki.fi>
Fixed the output for usage.
This diff is collapsed.
######################################################################
# $Id: Makefile.in,v 1.52 2002/12/24 04:23:57 hartmann Exp $
######################################################################
TARGET = freesweep
VERSION = 0.90
SRCS = clear.c drawing.c error.c fgui.c files.c game.c gpl.c main.c pbests.c\
play.c sl.c stats.c tick.c utils.c image.c
HEADS = sweep.h defaults.h acconfig.h
MISC = README Makefile sweeprc install-sh configure.in Makefile.in\
config.guess configure config.sub sweep.h.in freesweep.6.in CHANGES\
config.h.in
CLEANUP = a.out $(TARGET) core made $(OBJS) config.cache config.log\
config.status
srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}
#bindir = $(exec_prefix)/bin
bindir = ${exec_prefix}/bin
CC = gcc
CFLAGS = -Wall -DVERSION=\"$(VERSION)\" -g -O2
LIBS = -lm -lncurses
LDFLAGS =
OBJS = $(SRCS:.c=.o)
TARGET_DIR = $(TARGET)-$(VERSION)
FILES = $(SRCS) $(MISC) $(HEADS)
# for systems that have purify
PURE_ARGS = /s/purify/bin/purify -collector=/s/purify/bin/collect2
.SUFFIXES: .c .o
.PHONY: clean sterile lines distclean maintainer-clean mrproper
#######################################################################
%.o: %.c $(HEADS) Makefile
@/bin/rm -f $*.o
$(CC) $(CFLAGS) -c $<
$(TARGET): $(OBJS) $(HEADS) $(MISC)
@/bin/rm -f $(TARGET)
$(PURIFY) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $(TARGET)
configure: configure.in
autoconf
#config.h.in: acconfig.h
# autoheader
clean:
@-/bin/rm -rf $(CLEANUP)
pure:
@make clean
@make "PURIFY=$(PURE_ARGS)"
install: $(TARGET) $(TARGET).6
touch sweeptimes
./install-sh -c -m 2555 -o root -g games -s $(TARGET) $(bindir)/$(TARGET)
./install-sh -c -m 0664 -o root -g games sweeptimes /sweeptimes
./install-sh -c -m 0644 -o root -g games sweeprc /usr/local/share/sweeprc
./install-sh -c -m 0444 -o root -g games $(TARGET).6 ${prefix}/man/man6/$(TARGET).6
distclean:
@make sterile
maintainer-clean:
@make sterile
mrproper:
@make sterile
sterile:
-make clean
@-/bin/rm -f *.o core made $(TARGET) a.out sweep.h configure Makefile freesweep.6 debug.log
tar: $(SRCS) $(MISC)
(cd ../ ; ln -s sweep $(TARGET_DIR))
(cd ../ ; /bin/tar cvfh $(TARGET_DIR).tar $(FILES:%=$(TARGET_DIR)/%))
(cd ../ ; rm $(TARGET_DIR))
tags: $(SRCS) $(HEADS) $(MISC)
@ctags $(SRCS) $(HEADS)
lines: $(SRCS) $(HEADS)
@echo 'Total lines of code:'
@wc -l $(SRCS) $(HEADS) | sort -rn
######################################################################
# $Id: Makefile.in,v 1.52 2002/12/24 04:23:57 hartmann Exp $
# $Id: Makefile.in,v 1.53 2003-10-11 20:47:54 hartmann Exp $
######################################################################
TARGET = freesweep
VERSION = 0.90
VERSION = 1.0.1
SRCS = clear.c drawing.c error.c fgui.c files.c game.c gpl.c main.c pbests.c\
play.c sl.c stats.c tick.c utils.c image.c
HEADS = sweep.h defaults.h acconfig.h
MISC = README Makefile sweeprc install-sh configure.in Makefile.in\
config.guess configure config.sub sweep.h.in freesweep.6.in CHANGES\
MISC = README.md Makefile sweeprc install-sh configure.in Makefile.in\
config.guess configure config.sub sweep.h.in freesweep.6.in \
config.h.in
CLEANUP = a.out $(TARGET) core made $(OBJS) config.cache config.log\
config.status
......
This will eventually be a readme file. For now, just a list of notes.
Freesweep is licensed under the GNU GPL, version 2 or above. See
the file COPYING, run freesweep with the -g flag, or hit 'g' while playing
the game to see it. The code is copyright Gus Hartmann and Peter Keller.
We need to have some sort of standard header in all the files
the mentions the copyright and GNU GPL.
Bugs should be mailed to sweep@cs.wisc.edu, if it works, or
hartmann@cs.wisc.edu otherwise.
Color works, but right now the values are not customizable. Sorry.
If no file locking mechanism is found, group-writable best times
will be disabled.
While the game is playable on any terminal supported by curses/ncurses,
the help and high scores windows are designed to use a screen 80 columns wide.
On most X keymaps, both the left arrow and the down arrow don't
work, reporting "Unknown keystroke." Unfortunately, somehow this leaves an
extra 'o' lying around, leading to a saved game getting loaded. Really
fucking bizarre- Sun's curses doesn't have the arrows-under-X problem.
Fix up the error condition for what happens when you can't write to the
best times file and shit. Just quitting doesn't seem to good.
Also, fix the creation permissions of the group file. Like either the client
can make a new one with 666 perms, or the installer makes one with the
correct permissions.
See if purify bitches about what I wrote with the reconfig shit.
See what purify is bitching about in the load/save game code.
Sun's curses doesn't do standout() correctly on a Linux term.
Special thanks to Pete Keller for lots of help.
Thanks to the FSF for the license and certain chunks of code.
Thanks to the Undergraduate Project Lab at the University of Wisconsin
#freesweep
Freesweep is a console minesweeper-style game written in C for Unix-like
systems. The ncurses library is preferred, but standard System V curses will
work almost perfectly. Features include boards up to 1024x1024, saving and
loading of boards, shared and individual "best times" files, and color.
Freesweep is maintained by Gus Hartmann <gus@gus-the-cat.org>, Peter Keller
<psilord@cs.wisc.edu>, and Randy Westlund <rwestlun@gmail.com>.
##License
Freesweep is licensed under the GNU GPL, version 2 or above. See the file
COPYING, run freesweep with the -g flag, or hit 'g' while playing the game to
see it. The code is copyright Gus Hartmann and Peter Keller.
##Notes
- Bugs should be filed at https://github.com/rwestlund/freesweep/issues
- Color works, but right now the values are not customizable. Sorry.
- If no file locking mechanism is found, group-writable best times will be
disabled.
- While the game is playable on any terminal supported by curses/ncurses, the
help and high scores windows are designed to use a screen 80 columns wide.
Special thanks to Pete Keller for lots of help.
Thanks to the FSF for the license and certain chunks of code.
Thanks to the Undergraduate Project Lab at the University of Wisconsin
- On most X keymaps, both the left arrow and the down arrow don't work,
reporting "Unknown keystroke." Unfortunately, somehow this leaves an extra
'o' lying around, leading to a saved game getting loaded. Really fucking
bizarre- Sun's curses doesn't have the arrows-under-X problem.
- We need to have some sort of standard header in all the files the mentions
the copyright and GNU GPL.
- Fix up the error condition for what happens when you can't write to the best
times file and shit. Just quitting doesn't seem to good. Also, fix the
creation permissions of the group file. Like either the client can make a new
one with 666 perms, or the installer makes one with the correct permissions.
- See if purify bitches about what I wrote with the reconfig shit.
- See what purify is bitching about in the load/save game code.
- Sun's curses doesn't do standout() correctly on a Linux term.
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: clear.c,v 1.11 2002/07/12 07:06:44 hartmann Exp $
* $Id: clear.c,v 1.11 2002-07-12 07:06:44 hartmann Exp $
* *
**********************************************************************/
......
......@@ -3148,7 +3148,7 @@ cat >>confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
EOF
for ac_func in strdup memset memmove fileno lockf flock get_current_dir_name
for ac_func in strdup memset memmove fileno lockf flock get_current_dir_name strncpy strncat
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:3154: checking for $ac_func" >&5
......
dnl
dnl $Id: configure.in,v 1.43 2002/12/24 03:54:26 hartmann Exp $
dnl $Id: configure.in,v 1.44 2003-10-11 20:50:50 hartmann Exp $
dnl
dnl IU_LIB_NCURSES -- check for, and configure, ncurses
......@@ -175,7 +175,7 @@ AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strdup memset memmove fileno lockf flock get_current_dir_name)dnl
AC_CHECK_FUNCS(strdup memset memmove fileno lockf flock get_current_dir_name strncpy strncat)dnl
# Look for lesser but similar functions.
AC_DEFUN([AC_FUNC_SNPRINTF],
......
/*********************************************************************
* $Id: defaults.h,v 1.9 1999/08/06 07:25:26 hartmann Exp $
* $Id: defaults.h,v 1.9 1999-08-06 07:25:26 hartmann Exp $
*********************************************************************/
#ifndef __DEFAULTS_H__
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: drawing.c,v 1.24 2002/12/24 05:44:39 hartmann Exp $
* $Id: drawing.c,v 1.25 2003-10-11 20:50:50 hartmann Exp $
* *
**********************************************************************/
......@@ -94,6 +94,7 @@ void AskPrefs(GameStats* Game)
Status=1;
mvprintw(CurrentLine,(26+L_MAX_H),"%d",Game->Height);
}
/* Maybe put help here? */
else
{
Value=atoi(ValueBuffer);
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: error.c,v 1.8 2000/11/07 05:34:17 hartmann Exp $
* $Id: error.c,v 1.8 2000-11-07 05:34:17 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: fgui.c,v 1.17 2002/07/12 07:08:03 hartmann Exp $
* $Id: fgui.c,v 1.18 2003-10-11 20:50:50 hartmann Exp $
* *
**********************************************************************/
......@@ -62,7 +62,11 @@ struct FileBuf* CreateFileBuf(char *dir)
tmp->next = NULL;
/* create the full name for it */
#if defined(HAVE_STRNCPY)
strncpy(tmp->fpath, path, (strlen(dp->d_name) + strlen(path) + 2));
#else
strcpy(tmp->fpath, path);
#endif
if (strcmp(path,"/")!=0)
{
strcat(tmp->fpath, "/");
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: files.c,v 1.9 2002/12/19 07:04:05 hartmann Exp $
* $Id: files.c,v 1.10 2003-10-11 20:50:50 hartmann Exp $
* *
**********************************************************************/
......@@ -104,9 +104,11 @@ int SourceHomeFile(GameStats* Game)
perror("SourceHomeFile::getenv");
return 1;
}
strcpy(Pathname,Buffer);
strcat(Pathname,"/");
strcat(Pathname,DFL_PREFS_FILE);
#if defined(HAVE_SNPRINTF)
snprintf(Pathname, MAX_LINE, "%s/%s", Buffer, DFL_PREFS_FILE);
#else
snprintf(Pathname, MAX_LINE, "%s/%s", Buffer, DFL_PREFS_FILE);
#endif
if ((PrefsFile=fopen(Pathname,"r"))==NULL)
{
......@@ -167,9 +169,11 @@ int WritePrefsFile(GameStats* Game)
return 1;
}
strcpy(Pathname,Buffer);
strcat(Pathname,"/");
strcat(Pathname,DFL_PREFS_FILE);
#if defined(HAVE_SNPRINTF)
snprintf(Pathname, MAX_LINE, "%s/%s", Buffer, DFL_PREFS_FILE);
#else
sprintf(Pathname, "%s/%s", Buffer, DFL_PREFS_FILE);
#endif
if ((PrefsFile=fopen(Pathname,"w"))==NULL)
{
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: game.c,v 1.32 1999/08/09 05:25:35 hartmann Exp $
* $Id: game.c,v 1.32 1999-08-09 05:25:35 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: gpl.c,v 1.12 1999/08/09 05:25:36 hartmann Exp $
* $Id: gpl.c,v 1.12 1999-08-09 05:25:36 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: image.c,v 1.3 2000/11/07 05:31:26 hartmann Exp $
* $Id: image.c,v 1.3 2000-11-07 05:31:26 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: main.c,v 1.35 2002/12/19 07:04:05 hartmann Exp $
* $Id: main.c,v 1.35 2002-12-19 07:04:05 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: pbests.c,v 1.29 2000/11/07 05:31:09 hartmann Exp $
* $Id: pbests.c,v 1.30 2003-10-11 20:50:50 hartmann Exp $
* *
**********************************************************************/
......@@ -382,7 +382,11 @@ struct BestEntry* NewBestEntry(GameStats *Game)
SweepError("You do not have a username!");
buf = "unknown";
}
#if defined(HAVE_STRNCPY)
strncpy(b->name, buf, MAX_NAME);
#else
strcpy(b->name, buf);
#endif
/* get the real time it was completed */
time(&now);
......@@ -396,7 +400,11 @@ struct BestEntry* NewBestEntry(GameStats *Game)
{
*p = 0;
}
#if defined(HAVE_STRNCPY)
strncpy(b->date, buf, MAX_DATE);
#else
strcpy(b->date, buf);
#endif
/* add _ instead of spaces for easier data format storage */
while((p = strchr(b->date, ' ')) != NULL)
......@@ -426,8 +434,11 @@ char* FPTBTF(void)
fp = (char*)xmalloc(strlen(home) + strlen(DFL_BESTS_FILE) + 2);
/* make the full path */
strcpy(fp, home);
strcat(fp, "/" DFL_BESTS_FILE);
#if defined(HAS_SNPRINTF)
snprintf(fp, strlen(home) + strlen(DFL_BESTS_FILE) + 2, "%s/%s", home, DFL_BESTS_FILE);
#else
sprintf(fp, "%s/%s", home, DFL_BESTS_FILE);
#endif
return fp;
}
......@@ -439,11 +450,14 @@ char* FPTGBTF(void)
char *fp = NULL;
/* get me some memory for the string */
fp = (char*)xmalloc(strlen(mkstr(SCORESDIR)) + 11);
fp = (char*)xmalloc(strlen(mkstr2(SCORESDIR)) + 11);
/* make the full path */
strcpy(fp, mkstr(SCORESDIR));
strcat(fp, "/sweeptimes");
#if defined(HAS_SNPRINTF)
snprintf(fp, (strlen(mkstr2(SCORESDIR)) + 11), "%s/sweeptimes", mkstr2(SCORESDIR));
#else
sprintf(fp, "%s/sweeptimes", mkstr2(SCORESDIR));
#endif
return fp;
}
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: play.c,v 1.41 2002/12/19 07:04:05 hartmann Exp $
* $Id: play.c,v 1.41 2002-12-19 07:04:05 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: sl.c,v 1.10 2000/11/07 05:29:03 hartmann Exp $
* $Id: sl.c,v 1.10 2000-11-07 05:29:03 hartmann Exp $
* *
**********************************************************************/
......
......@@ -4,7 +4,7 @@
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: stats.c,v 1.11 2002/12/20 08:44:53 hartmann Exp $
* $Id: stats.c,v 1.11 2002-12-20 08:44:53 hartmann Exp $
* *
**********************************************************************/
......
/*********************************************************************
* $Id: sweep.h.in,v 1.36 2002/12/21 21:32:09 hartmann Exp $
*********************************************************************/
#ifndef __SWEEP_H__
#define __SWEEP_H__
#include "config.h"
#define mkstr(s) # s
/* The library header files. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_STRING_H
#include <string.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif /* HAVE_GETOPT_H */
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif /* HAVE_ERRNO_H */
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <signal.h>
#ifdef HAVE_LIBNCURSES
#include "/ncurses.h"
#define DEFAULT_LINEDRAW 1
#else /* HAVE_LIBNCURSES */
#include <curses.h>
#define DEFAULT_LINEDRAW 0
#endif /* HAVE_LIBNCURSES */
#if defined HAVE_FLOCK && defined HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#if defined(HAVE_LIMITS_H)
#include <limits.h>
#endif
/* XXX make this work with configure */
#include <sys/types.h>
#include <dirent.h>
#ifdef NCURSES_MOUSE_VERSION
#define SWEEP_MOUSE
#endif /* NCURSES_MOUSE_VERSION */
#if defined SCORESDIR
#define USE_GROUP_BEST_FILE
#endif
#include "defaults.h"
/* These are all the defines used in freesweep */
/* These are defines for convenience */
#define DELIMITERS " \t="
#define DFL_GROUP_PATH ""
#define MAGIC_NUMBER 128
#ifdef __CYGWIN__
#define DFL_PREFS_FILE "_sweeprc"
#define DFL_BESTS_FILE "_sweeptimes"
#else
#define DFL_PREFS_FILE ".sweeprc"
#define DFL_BESTS_FILE ".sweeptimes"
#endif /* __CYGWIN__ */
#define GLOBAL_PREFS_FILE "/usr/local/share/sweeprc"
/* used for the superclick feature in the game */
#define SUPERCLICK 0
#define DIE 1
#define DONOTHING 2
/* These are defines for maximum accepted values */
#define MAX_LINE 1024
#define MAX_H 2048
#define MAX_W 2048
#define L_MAX_H 4
#define L_MAX_W 4
#define INFO_W 21
#define MAX_NAME 80
#define MAX_DATE 26
/* These are the macros for cell values. */
#define UNKNOWN 0x0
#define MINE 0x9
#define MARKED 0xa
#define BAD_MARK 0xb
#define EMPTY 0xc
#define DETONATED 0xd
/* These are for winning and losing. */
#define INPROG 0
#define WIN 1
#define LOSE 2
#define ABORT 3
#define RECONF 4
/* These are for the alert types. */
#define BEEP 0
#define FLASH 1
#define NO_ALERT 2
/* These are the macros that reduce the memory usage by *half*. */
#define GetMine(x,y,ret) \
ret=(unsigned char)(!((ret)=Game->Field[((x)/2+(y)*( ( Game->Width +1 )/2))])\
?UNKNOWN:((x)%2)?(ret)&0x0f:((ret)&0xf0)>>4)
#define SetMine(x,y,val) \
Game->Field[((x)/2)+(y)*( ( Game->Width +1 )/2)]=(!((x)%2)?((Game->Field[((x)\
/2)+(y)*( ( Game->Width +1 )/2)]&0x0f)|((unsigned char)(val)<<4)):\
((Game->Field[((x)/2)+(y)*( ( Game->Width +1 ) /2)]&0xf0)|((unsigned char)(val)\
&0x0f)))
/* This extends the naming convention of ncurses functions. */
#define mvclrtoeol(y,x) (move(y,x)==ERR?ERR:clrtoeol());
#define noutrefresh() wnoutrefresh(stdscr)
#ifndef mvwhline
#define mvwhline(w,y,x,z,n) (wmove(w,y,x)==ERR?ERR:whline(w,z,n));
#endif /* mvwhline */
#ifndef mvwvline
#define mvwvline(w,y,x,z,n) (wmove(w,y,x)==ERR?ERR:wvline(w,z,n));
#endif /* mvwvline */
#ifndef mvgetnstr
#define mvgetnstr(y, x, str, n) (wmove(stdscr, y, x)==ERR?ERR:wgetnstr(stdscr, str, n));
#endif /* mvgetnstr */
#ifndef ValidCoordinate
#define ValidCoordinate(x,y) ( ( (x>=0) && (x<Game->Width) && (y>=0) && (y<Game->Height) ) ? 1 : 0 )
#endif
/* These are all the structs used in freesweep */
/* This is the struct containing all the various drawing characters. */
typedef struct _DrawChars
{
chtype ULCorner;
chtype URCorner;
chtype LLCorner;
chtype LRCorner;
chtype HLine;
chtype VLine;
chtype UArrow;
chtype DArrow;
chtype LArrow;
chtype RArrow;
chtype Mine;
chtype Space;
chtype Mark;
chtype FalseMark;
chtype Bombed;
} DrawChars;
/* This is the struct containing all the relevant game information. */
typedef struct _GameStats
{
int Height;
int Width;
int Percent;
unsigned int NumMines;
unsigned int MarkedMines;
unsigned int BadMarkedMines;
int Color;
int Fast;
int Alert;
int LineDraw;
int CursorX, CursorY;
int LargeBoardX, LargeBoardY;
int Status;
unsigned int FocusX, FocusY;
unsigned int Time;
unsigned char* Field;
WINDOW* Border;
WINDOW* Board;
} GameStats;
/* This is the struct for the clearing algo. */
struct Mark
{
int x, y;
struct Mark *next;
};
/* this is the _NEW_ format for the best times score */
struct BestEntry
{
unsigned int area;
unsigned int mines;
unsigned int time;
char name[MAX_NAME];
char date[MAX_DATE];
char *attribs;
};
struct BestFileDesc
{
/* the array of entries from the file, with one more in it. */
struct BestEntry *ents;
/* the number of entries in the descriptor */
int numents;
/* did I replace, or add? */
int replflag;
};
typedef struct _CoordPair
{
int CoordX, CoordY;
} CoordPair;
/* stuff needed for the file gui */
/* this is not very well designed, but oh well */
struct FileBuf
{
char *fpath;
char *path;
int numents;
struct FileBuf *next;
struct FileBuf *prev;
};
#ifdef DEBUG_LOG
FILE* DebugLog;
#endif /* DEBUG_LOG */
DrawChars CharSet;
/* These are the functions defined in files.c */
int SourceHomeFile(GameStats* Game);
int SourceGlobalFile(GameStats* Game);
int SourceFile(GameStats* Game,FILE* PrefsFile);
int WritePrefsFile(GameStats* Game);
int OldPrefsFile(GameStats* Game);
/* These are the functions defined in drawing.c */
void StartCurses();
void PrintInfo();
void AskPrefs(GameStats* Game);
void Help();
void PrintBestTimes(char* FileName);
int DrawBoard(GameStats* Game);
void DrawCursor(GameStats* Game);
void UndrawCursor(GameStats* Game);
int Pan(GameStats* Game);
int Center(GameStats* Game);
int CenterY(GameStats* Game);
int CenterX(GameStats* Game);
/* These are the functions defined in game.c */
int CheckColor(int NewVal);
int CheckFast(int NewVal);
int CheckHeight(int NewVal);
int CheckLineDraw(int NewVal);
int CheckNumMines(int NewVal, int Height, int Width);
int CheckPercent(int NewVal);
int CheckWidth(int NewVal);
int InitGame(GameStats* Game);
int ReadyGame(GameStats* Game);
void SwitchCharSet(GameStats* Game);
int InitCharSet(GameStats* Game,int Value);
void SetCharSet(int Value);
int ParseArgs(GameStats* Game, int Argc, char** Argv);
void DumpGame(GameStats* Game);
int ReReadyGame(GameStats* Game);
void Wipe(GameStats *Game);
/* These are the functions defined in play.c */
int GetInput(GameStats* Game);
void MoveLeft(GameStats* Game, int Num);
void MoveRight(GameStats* Game, int Num);
void MoveUp(GameStats* Game, int Num);
void MoveDown(GameStats* Game, int Num);
void Boom(void);
void YouWin(void);
int ClickSquare(GameStats* Game, int ThisX, int ThisY);
int DoubleClickSquare(GameStats* Game, int ThisX, int ThisY);