Set up solve state
This commit is contained in:
parent
302314ee79
commit
cf84ae2017
26
main.c
26
main.c
@ -5,10 +5,14 @@
|
||||
|
||||
#include "puzz.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
enum { UNKNOWN = 0xfe };
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
@ -21,5 +25,27 @@ int main(void)
|
||||
gen();
|
||||
print();
|
||||
|
||||
puzz_t field;
|
||||
memset(field, UNKNOWN, sizeof(field));
|
||||
|
||||
for (int y = 0; y < HEIGHT; ++y) {
|
||||
for (int x = 0; x < WIDTH; ++x) {
|
||||
char c;
|
||||
switch (field[x][y]) {
|
||||
case UNKNOWN:
|
||||
c = '?';
|
||||
break;
|
||||
case MINE:
|
||||
c = 'x';
|
||||
break;
|
||||
default:
|
||||
c = '0' + field[x][y];
|
||||
break;
|
||||
}
|
||||
putchar(c);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user