-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnonogramWriter.h
More file actions
35 lines (29 loc) · 845 Bytes
/
nonogramWriter.h
File metadata and controls
35 lines (29 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <cstdio>
#ifndef NONOGRAMWRITER_H
#define NONOGRAMWRITER_H
class NonogramWriterInterface{
public:
virtual void saveResult(struct Board* b) = 0;//this should be declared to 0
};
class NonogramWriter_Tourament: public NonogramWriterInterface{
public:
virtual void saveResult(struct Board* b){
char outputName[100];
//sprintf(outputName, "%d.out", b->problemNum);
sprintf(outputName, "solution.txt");
fprintf(stderr, "saveresult %s\n", outputName);
FILE* f = fopen(outputName, "a");
if(f == NULL){
fprintf(stderr, "cannot open file %s\n", outputName);
return;
}
b->saveSimpleResult(f);//BUG: cannot see answer after $200
fclose(f);
}
};
class NonogramWriter: public NonogramWriterInterface{
virtual void saveResult(struct Board* b){
b->saveFullResult();
}
};
#endif