-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooter.cpp
More file actions
125 lines (110 loc) · 3 KB
/
footer.cpp
File metadata and controls
125 lines (110 loc) · 3 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include "kfilter.hpp"
void do_solvingtime(TiXmlElement* root)
{
char* st;
TiXmlNode* tnode;
TiXmlElement* diag;
tnode = root->FirstChild("SolvingTime");
diag = tnode->ToElement();
st = (char*) diag->GetText();
printf("\nSolving time: %s seconds\n", st);
return;
}
void do_parameters(TiXmlNode* options)
{
TiXmlNode* tnode;
TiXmlElement* telem;
char* text;
char onoffst[4];
puts("\nSolving Parameters");
puts("------------------");
// sols
tnode = options->FirstChild("sols");
telem = tnode->ToElement();
text = (char*) telem->GetText();
printf("\nIntended solutions: %s,", text);
// set
tnode = options->FirstChild("set");
telem = tnode->ToElement();
text = (char*) telem->GetText();
if (strcmp(text, "true") == 0) {
strcpy(onoffst, "on");
} else {
strcpy(onoffst, "off");
}
printf(" Set play: %s,", onoffst);
// tries
tnode = options->FirstChild("tries");
telem = tnode->ToElement();
text = (char*) telem->GetText();
if (strcmp(text, "true") == 0) {
strcpy(onoffst, "on");
} else {
strcpy(onoffst, "off");
}
printf(" Try play: %s\n", onoffst);
// refuts
tnode = options->FirstChild("refuts");
telem = tnode->ToElement();
text = (char*) telem->GetText();
printf("Refutations: %s,", text);
// trivialtries
tnode = options->FirstChild("trivialtries");
telem = tnode->ToElement();
text = (char*) telem->GetText();
if (strcmp(text, "true") == 0) {
strcpy(onoffst, "on");
} else {
strcpy(onoffst, "off");
}
printf(" Trivialtries: %s,", onoffst);
// actual
tnode = options->FirstChild("actual");
telem = tnode->ToElement();
text = (char*) telem->GetText();
if (strcmp(text, "true") == 0) {
strcpy(onoffst, "on");
} else {
strcpy(onoffst, "off");
}
printf(" Actual play: %s\n", onoffst);
// threats
tnode = options->FirstChild("threats");
telem = tnode->ToElement();
text = (char*) telem->GetText();
printf("Threats: %s,", text);
// fleck
tnode = options->FirstChild("fleck");
telem = tnode->ToElement();
text = (char*) telem->GetText();
if (strcmp(text, "true") == 0) {
strcpy(onoffst, "on");
} else {
strcpy(onoffst, "off");
}
printf(" Fleck: %s,", onoffst);
// shortvars
tnode = options->FirstChild("shortvars");
telem = tnode->ToElement();
text = (char*) telem->GetText();
if (strcmp(text, "true") == 0) {
strcpy(onoffst, "on");
} else {
strcpy(onoffst, "off");
}
printf(" Shortvars: %s\n", onoffst);
return;
}
void do_footer()
{
char formtime[100];
time_t caltime;
struct tm* ltimeptr;
struct tm ltime;
caltime = time(NULL);
ltimeptr = localtime(&caltime);
ltime = *ltimeptr;
strftime(formtime, 100, "on %a %d %B at %T", <ime);
printf("\nSolved by %s version %s %s\n", PROGRAM_NAME, VERSION, formtime);
return;
}