diff --git a/sources/fifteen.c b/sources/fifteen.c index 7f4b751..05bae9c 100644 --- a/sources/fifteen.c +++ b/sources/fifteen.c @@ -14,6 +14,12 @@ No rights are reserved and this software comes with no warranties of any kind to compile with -lncurses */ + +/* The Plan9 compiler can not handle VLAs */ +#ifdef Plan9 +#define size 4 +#endif + typedef signed char byte; byte size; byte py,px; @@ -178,7 +184,9 @@ void gameplay(void){ erase(); } int main(int argc, char** argv){ +#ifndef Plan9 size=4; +#endif if(argc==2){ if(!strcmp("help",argv[1])){ printf("Usage: %s [size]\n",argv[0]); diff --git a/sources/fisher.c b/sources/fisher.c index 80b4fcf..21df6c2 100644 --- a/sources/fisher.c +++ b/sources/fisher.c @@ -14,6 +14,11 @@ #define HLEN LEN/2 #define WID 80 #define HWID WID/2 + +#ifdef Plan9 +#define usleep(1000x) sleep(x) /*milliseconds*/ +#endif + typedef signed char byte; chtype colors[4]={A_NORMAL,A_STANDOUT}; byte fish[10]={0};//positions @@ -394,7 +399,7 @@ void main(void){ if(!hooknum) break; if(input!=ERR){ - sleep(1); + usleep(100000); flushinp(); } } diff --git a/sources/memoblocks.c b/sources/memoblocks.c index 2e3d9e8..9335f6a 100644 --- a/sources/memoblocks.c +++ b/sources/memoblocks.c @@ -14,6 +14,13 @@ No rights are reserved and this software comes with no warranties of any kind to compile with -lncurses */ + +/* The Plan9 compiler can not handle VLAs */ +#ifdef Plan9 +#define size 8 +#define size2 16 +#endif + typedef signed char byte; typedef unsigned char ubyte; byte size,size2;//size2 is there to avoid a lot of multiplications @@ -162,7 +169,9 @@ void gameplay(void){ erase(); } int main(int argc, char** argv){ - size=8; +#ifndef Plan9 + size=8; +#endif if(argc>=2){ size=atoi(argv[1]); if(size<3 || size>19){ @@ -199,9 +208,11 @@ int main(int argc, char** argv){ } } else if(size>8)//big sizes depend on color display +#ifndef Plan9 size=8; size2=size*2; - chtype board[size][size2]; +#endif + chtype board[size][size2]; bool show[size][size2]; int input; time_t tstart,now; diff --git a/sources/miketron.c b/sources/miketron.c index 51de319..34bd8e5 100644 --- a/sources/miketron.c +++ b/sources/miketron.c @@ -23,6 +23,13 @@ No rights are reserved and this software comes with no warranties of any kind to compile with -lncurses */ + +/* The Plan9 compiler can not handle VLAs */ +#ifdef Plan9 +#define len 10 +#define wid 40 +#endif + typedef signed char byte; int len,wid,py,px; int immunity,flight,notrail; diff --git a/sources/mines.c b/sources/mines.c index 0898144..256b61a 100644 --- a/sources/mines.c +++ b/sources/mines.c @@ -16,6 +16,13 @@ No rights are reserved and this software comes with no warranties of any kind to compile with -lncurses */ + +/* The Plan9 compiler can not handle VLAs */ +#ifdef Plan9 +#define len 8 +#define wid 8 +#endif + typedef signed char byte; int len,wid,py,px,flags; int untouched; @@ -226,7 +233,9 @@ int main(int argc, char** argv){ } else +#ifndef Plan9 len=wid=8; +#endif if(argc==4){ if( !sscanf(argv[3],"%d",&mscount)){ puts("Invalid input."); diff --git a/sources/mkfile b/sources/mkfile index 783b377..b61fbcb 100644 --- a/sources/mkfile +++ b/sources/mkfile @@ -5,19 +5,19 @@ APE=/sys/src/ape TARG=\ battleship \ checkers \ -# fifteen \ + fifteen \ fisher \ jewels \ -# memoblocks \ -# miketron \ -# mines \ -# muncher \ -# pipes \ -# rabbithole \ + memoblocks \ + miketron \ + mines \ + muncher \ + pipes \ + rabbithole \ redsquare \ reversi \ -# sos \ -# sudoku + sos \ + sudoku BIN=/$objtype/bin/games @@ -27,6 +27,7 @@ UPDATE=\ 2){ if (strlen(argv[2])>1 || argv[2][0]-'0'>4 || argv[2][0]-'0'<= 0 ){ printf("1 <= diff <=4\n"); @@ -345,7 +354,9 @@ int main(int argc,char** argv){ colors[b]=COLOR_PAIR(b+1); } } +#ifndef Plan9 s= size*size; +#endif char board[s][s]; char empty[s][s]; char game[s][s];