I am writing aa mastermind guessing game, but in the “White Check”, I need to remember (know) the positions of all the position “Blacks”. These positions are not required checking again. ...
“White" is the checking of correct number at wrong position. But I don't know how to count it correctly.
#include "stdafx.h" #include "stdlib.h" #include "time.h" int _tmain(int argc, _TCHAR* argv[]) { int answer[4]; ...
The following code has segfault problems (It is also posted at pastebin):
#include <stdio.h> #include <string.h> #include <stdbool.h> #include "mygetch.h" #define MAX_SIZE 255 #define SCR_CLEAR "\033[2J\033[;H" void getgrid(int, int); void resetgrid(void); void getkey(void); static bool grid[5][5] = {{0,0,0,0,0}, ...