1
0
mirror of https://github.com/abakh/nbsdgames.git synced 2025-01-03 14:56:23 -05:00

Mac problem

This commit is contained in:
untakenstupidnick 2019-04-04 07:18:54 +04:30
parent 5a51a8ba83
commit 040498a4f8
2 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -19,7 +19,7 @@ compile with -lncurses
NOTE: This program is only made for entertainment porpuses. The puzzles are generated by randomly clearing tiles on the table and are guaranteed to have a solution , but are not guaranteed to have only one unique solution. NOTE: This program is only made for entertainment porpuses. The puzzles are generated by randomly clearing tiles on the table and are guaranteed to have a solution , but are not guaranteed to have only one unique solution.
*/ */
typedef signed char byte; typedef signed char byte;
byte wait=0, waitcycles=0; byte _wait=0, waitcycles=0;//apparently 'wait' conflicts with a variable in a library macOS includes by default
byte size,s;//s=size*size byte size,s;//s=size*size
byte py,px; byte py,px;
byte diff; byte diff;
@ -136,8 +136,8 @@ bool fill_with(char board[s][s],char fillwith){//returns 1 on failure
void fill(char board[s][s]){ void fill(char board[s][s]){
for(byte num=1;num<=s;num++){//it fills random places in the board with 1s, then random places in the remaining space with 2s and so on... for(byte num=1;num<=s;num++){//it fills random places in the board with 1s, then random places in the remaining space with 2s and so on...
if(num==4){//something that randomly happens if(num==4){//something that randomly happens
wait=(wait+1)%60; _wait=(_wait+1)%60;
if(!wait && waitcycles<3) if(!_wait && waitcycles<3)
waitcycles++; waitcycles++;
} }
if ( fill_with(board,int2sgn(num) ) ){ if ( fill_with(board,int2sgn(num) ) ){
@ -147,7 +147,7 @@ void fill(char board[s][s]){
if(waitcycles==3) if(waitcycles==3)
mvaddstr(2,0,"(You can set SUDOKU_FASTGEN if you just want to see if it works)"); mvaddstr(2,0,"(You can set SUDOKU_FASTGEN if you just want to see if it works)");
move(0,45); move(0,45);
for(byte b=0;b<wait;b+=10) for(byte b=0;b<_wait;b+=10)
addch('.'); addch('.');
} }
} }