diff --git a/battleship.c b/battleship.c index e44d828..bdae8bd 100644 --- a/battleship.c +++ b/battleship.c @@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define RED 3 #define CYAN 2 #define ENGLISH_LETTERS 26 -typedef signed char byte; typedef unsigned char bitbox; bool multiplayer; diff --git a/byte.h b/byte.h new file mode 100644 index 0000000..05fb09f --- /dev/null +++ b/byte.h @@ -0,0 +1,3 @@ +#ifndef byte + #define byte signed char //ugly, i know +#endif diff --git a/checkers.c b/checkers.c index f351d75..ff93f30 100644 --- a/checkers.c +++ b/checkers.c @@ -28,7 +28,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define ALT_IMG 2 #define ALT_NRM 3 #define WIN 100000 -typedef signed char byte; + byte py,px;//cursor byte cy,cx;//selected(choosen) piece diff --git a/common.h b/common.h index ca4419e..4bededb 100644 --- a/common.h +++ b/common.h @@ -14,7 +14,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include "config.h" #define FOPEN_FAIL -10 -typedef signed char byte; + FILE* score_file; byte score_write(const char* path, long wscore, byte save_to_num){// only saves the top 10, returns the place in the chart score_file=fopen(path,"r"); diff --git a/config.h b/config.h index b409033..0029236 100644 --- a/config.h +++ b/config.h @@ -48,3 +48,9 @@ } #define usleep(x) microsleep(x) #endif + +typedef signed char byte; + +#ifndef M_PI //i don't know why tf, but it happens + #define M_PI 3.1415 +#endif diff --git a/darrt.c b/darrt.c index 86d2455..a92b1f9 100644 --- a/darrt.c +++ b/darrt.c @@ -30,7 +30,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define SHOTS_WHEN_STARTING 10 #define randint(a,b) ((a)+(rand()%((b+1)-(a)))) -typedef signed char byte; #ifdef Plan9 int usleep(long usec) { int second = usec/1000000; diff --git a/fifteen.c b/fifteen.c index 5d192ee..1cd4c0a 100644 --- a/fifteen.c +++ b/fifteen.c @@ -16,7 +16,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include #include "config.h" -typedef signed char byte; /* The Plan9 compiler can not handle VLAs */ #ifdef NO_VLA diff --git a/fisher.c b/fisher.c index 475c24f..b72b8c2 100644 --- a/fisher.c +++ b/fisher.c @@ -27,7 +27,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define HLEN LEN/2 #define WID 80 #define HWID WID/2 -typedef signed char byte; #ifdef Plan9 int usleep(long usec) { int second = usec/1000000; diff --git a/jewels.c b/jewels.c index a92df90..73af389 100644 --- a/jewels.c +++ b/jewels.c @@ -24,7 +24,6 @@ TODO make it like puyo puyo instead of the remake of what i poorly remembered*/ #define WID 19 #define DELAY 2 #define SAVE_TO_NUM 10 -typedef signed char byte; chtype board[LEN][WID]; chtype colors[6]={0}; diff --git a/memoblocks.c b/memoblocks.c index e18133f..040cec8 100644 --- a/memoblocks.c +++ b/memoblocks.c @@ -17,7 +17,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include #include "config.h" -typedef signed char byte; typedef unsigned char ubyte; /* The Plan9 compiler can not handle VLAs */ diff --git a/miketron.c b/miketron.c index dd07b1f..635ab32 100644 --- a/miketron.c +++ b/miketron.c @@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define MINWID 40 #define MAXWID 80 enum {UP=1,RIGHT,DOWN,LEFT,FLIGHT,NOTRAIL,BOMB,SPAWN,STOP,SUPERFOOD,TRAIL}; -typedef signed char byte; /* The Plan9 compiler can not handle VLAs and usleep is a POSIX function */ #ifdef NO_VLA diff --git a/mines.c b/mines.c index 3ebf002..c9647de 100644 --- a/mines.c +++ b/mines.c @@ -20,7 +20,6 @@ compile with -lncurses #include "config.h" #define FLAG 9 #define UNCLEAR 10 -typedef signed char byte; #ifdef NO_VLA //The Plan9 compiler can not handle VLAs #define len 8 diff --git a/muncher.c b/muncher.c index 9c6aa28..f086362 100644 --- a/muncher.c +++ b/muncher.c @@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define MINWID 40 #define MAXWID 80 enum {UP=1,RIGHT,DOWN,LEFT,FOOD,SUPERFOOD,TRAP}; -typedef signed char byte; /* The Plan9 compiler can not handle VLAs */ #ifdef NO_VLA diff --git a/pipes.c b/pipes.c index ba602bf..06f65a8 100644 --- a/pipes.c +++ b/pipes.c @@ -30,7 +30,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define SAVE_TO_NUM 10 #define SY 0 #define SX 7 -typedef signed char byte; typedef unsigned char bitbox; /* The Plan9 compiler can not handle VLAs */ diff --git a/rabbithole.c b/rabbithole.c index a6388d1..597d334 100644 --- a/rabbithole.c +++ b/rabbithole.c @@ -25,7 +25,6 @@ compile with -lncurses #define LEFT 8 #define VISITED 16 #define CARROT 32 -typedef signed char byte; typedef unsigned char bitbox; /* The Plan9 compiler can not handle VLAs */ diff --git a/redsquare.c b/redsquare.c index 63acd39..106c81c 100644 --- a/redsquare.c +++ b/redsquare.c @@ -24,7 +24,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #define DEAD 0 #define ALIVE 1 #define RED 2 -typedef signed char byte; int level; byte py,px; diff --git a/reversi.c b/reversi.c index 5f99975..31ff16c 100644 --- a/reversi.c +++ b/reversi.c @@ -16,8 +16,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include #include -typedef signed char byte; - +#include "config.h" byte py,px;//cursor const char piece[2] = {'O','X'}; char game[8][8];//main board diff --git a/snakeduel.c b/snakeduel.c index b0a205b..b1ef049 100644 --- a/snakeduel.c +++ b/snakeduel.c @@ -40,7 +40,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t enum {UP=0,RIGHT,DOWN,LEFT}; enum {BLOCK=0,SURVIVAL,MIRROR,IMITATE}; -typedef signed char byte; /* The Plan9 compiler can not handle VLAs */ #ifdef NO_VLA #define len 36 diff --git a/sos.c b/sos.c index 9b53593..cab89e4 100644 --- a/sos.c +++ b/sos.c @@ -18,7 +18,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t #include #include "config.h" #define NOTHING 123 -typedef signed char byte; #ifdef NO_VLA #define len 5 diff --git a/sudoku.c b/sudoku.c index 43e36ec..7880c10 100644 --- a/sudoku.c +++ b/sudoku.c @@ -19,7 +19,6 @@ NOTE: This program is only made for entertainment porpuses. The puzzles are gene #include #include #include "config.h" -typedef signed char byte; byte _wait=0, waitcycles=0;//apparently 'wait' conflicts with a variable in a library macOS includes by default byte py,px;