mirror of
https://github.com/abakh/nbsdgames.git
synced 2024-12-04 14:46:22 -05:00
Adding Darrt
This commit is contained in:
parent
f7e9d822e4
commit
4a375b2998
31
Makefile
31
Makefile
@ -2,15 +2,9 @@
|
||||
|
||||
CFLAGS= -O3 -lncurses -Wno-unused-result
|
||||
#-O3 --std=c99 -lcurses -DNO_MOUSE for BSD curses
|
||||
<<<<<<< HEAD
|
||||
#adding --std=c99 makes warnings in GNU, and the blame is upon glibc feature test macros. my code is correct.
|
||||
|
||||
all: jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare darrt
|
||||
=======
|
||||
#adding --std=c99 makes warnings in GNU, and the blame is upon glibc feature test macros. my code is
|
||||
|
||||
all: jewels sudoku mines reversi checkers battleship rabbithole sos pipes fifteen memoblocks fisher muncher miketron redsquare
|
||||
>>>>>>> f85e9d66539b8e1fc5f4310f735c2077990e07c2
|
||||
scorefiles:
|
||||
touch /usr/games/pp_scores
|
||||
touch /usr/games/jw_scores
|
||||
@ -27,7 +21,6 @@ scorefiles:
|
||||
|
||||
jewels: jewels.c config.h
|
||||
$(CC) jewels.c $(CFLAGS) -o ./jewels
|
||||
<<<<<<< HEAD
|
||||
sudoku: sudoku.c config.h
|
||||
$(CC) sudoku.c $(CFLAGS) -lm -o ./sudoku
|
||||
mines: mines.c config.h
|
||||
@ -45,25 +38,6 @@ sos: sos.c config.h
|
||||
pipes: pipes.c config.h
|
||||
$(CC) pipes.c $(CFLAGS) -o ./pipes
|
||||
fifteen: fifteen.c config.h
|
||||
=======
|
||||
sudoku: sudoku.c
|
||||
$(CC) sudoku.c $(CFLAGS) -lm -o ./sudoku
|
||||
mines: mines.c
|
||||
$(CC) mines.c $(CFLAGS) -o ./mines
|
||||
reversi: reversi.c
|
||||
$(CC) reversi.c $(CFLAGS) -o ./reversi
|
||||
checkers: checkers.c
|
||||
$(CC) checkers.c $(CFLAGS) -o ./checkers
|
||||
battleship: battleship.c
|
||||
$(CC) battleship.c $(CFLAGS) -o ./battleship
|
||||
rabbithole: rabbithole.c
|
||||
$(CC) rabbithole.c $(CFLAGS) -o ./rabbithole
|
||||
sos: sos.c
|
||||
$(CC) sos.c $(CFLAGS) -o ./sos
|
||||
pipes: pipes.c config.h
|
||||
$(CC) pipes.c $(CFLAGS) -o ./pipes
|
||||
fifteen: fifteen.c
|
||||
>>>>>>> f85e9d66539b8e1fc5f4310f735c2077990e07c2
|
||||
$(CC) fifteen.c $(CFLAGS) -o ./fifteen
|
||||
memoblocks: memoblocks.c
|
||||
$(CC) memoblocks.c $(CFLAGS) -o ./memoblocks
|
||||
@ -73,15 +47,10 @@ muncher: muncher.c config.h
|
||||
$(CC) muncher.c $(CFLAGS) -o ./muncher
|
||||
miketron: miketron.c config.h
|
||||
$(CC) miketron.c $(CFLAGS) -o ./miketron
|
||||
<<<<<<< HEAD
|
||||
redsquare: redsquare.c config.h
|
||||
$(CC) redsquare.c $(CFLAGS) -o ./redsquare
|
||||
darrt: darrt.c config.h
|
||||
$(CC) darrt.c $(CFLAGS) -lm -o ./darrt
|
||||
=======
|
||||
redsquare: redsquare.c
|
||||
$(CC) redsquare.c $(CFLAGS) -o ./redsquare
|
||||
>>>>>>> f85e9d66539b8e1fc5f4310f735c2077990e07c2
|
||||
clean:
|
||||
rm ./jewels ./sudoku ./checkers ./mines ./reversi ./battleship ./rabbithole ./sos ./pipes ./fifteen ./memoblocks ./fisher ./muncher ./miketron ./redsquare ./darrt
|
||||
uninstall:
|
||||
|
44
config.h
44
config.h
@ -57,47 +57,3 @@
|
||||
}
|
||||
#define usleep(x) microsleep(x)
|
||||
#endif
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
#ifdef Plan9
|
||||
#define NO_VLA
|
||||
//Many ancient compilers don't have VLA support, including the Plan9 compiler
|
||||
//thought it would be nicer if it had its own flag instead of Plan9.
|
||||
#endif
|
||||
|
||||
|
||||
//#define NO_MOUSE
|
||||
//it seems there wasn't mouse support in original curses, and the variants
|
||||
//developed it indepedently, use if mouse doesn't work in your variant (e.g. BSD curses)
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#ifdef __unix__
|
||||
#define rand() random()
|
||||
#define srand(x) srandom(x)
|
||||
//At the time of writing, NetBSD's rand() is damn stupid.
|
||||
//rand()%4 constantly gives 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3.
|
||||
#endif
|
||||
|
||||
// It seems usleep is obsoleted in favor of nanosleep,
|
||||
// and some POSIX implementations lack it. but i refuse
|
||||
// to end using it! what the hell, filling a struct for
|
||||
// something as trivial as sleeping 0.1 seconds??
|
||||
|
||||
// the function is written by Jens Staal for Plan9
|
||||
#ifdef Plan9
|
||||
int microsleep(long usec){
|
||||
int second = usec/1000000;
|
||||
long nano = usec*1000 - second*1000000;
|
||||
struct timespec sleepy = {0};
|
||||
sleepy.tv_sec = second;
|
||||
sleepy.tv_nsec = nano;
|
||||
nanosleep(&sleepy, (struct timespec *) NULL);
|
||||
return 0;
|
||||
}
|
||||
#define usleep(x) microsleep(x)
|
||||
#endif
|
||||
>>>>>>> f85e9d66539b8e1fc5f4310f735c2077990e07c2
|
||||
|
Loading…
Reference in New Issue
Block a user