-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzak_create_table.c
70 lines (50 loc) · 1.24 KB
/
zak_create_table.c
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
#include <stdio.h>
#define PAGE_TITLE "ZAP'EM II™ Exit VISA Security System"
extern const char *html_preamble;
extern const char *svg_symbols;
#include "maniac_zak_symbols.h"
#include "decoder.h"
static void print_sequence(int section, int row, int column) {
int sequence[4];
int i;
decode(sequence, section, row, column);
for (i = 0; i < 4; i++) {
printf("<svg><use href=\"#%c\" /></svg>", sequence[i] + 'A');
}
}
static void print_code_table(int section) {
int i, j;
if (section < 7)
printf("<table style=\"page-break-after: always;\">\n");
else
printf("<table>\n");
printf("<caption>Section %d</caption>\n", section);
printf("<tr style=\"text-align: center;\"><td></td>");
for (i = 0; i < 7; i++)
printf("<th>%c</th>", 'A' + i);
printf("</tr>\n");
for (i = 1; i <= 30; i++) {
printf("<tr><th>%d</th>", i);
for (j = 1; j <= 7; j++) {
printf("<td>");
printf("<div class=\"symbols\">");
print_sequence(section, i, j);
printf("</div>");
printf("</td>");
}
printf("</tr>\n");
}
printf("</table>\n");
}
int main() {
int i;
puts(html_preamble);
printf("<body>\n");
puts(svg_symbols);
for (i = 1; i <= 7; i++) {
print_code_table(i);
}
printf("</body>\n");
printf("</html>\n");
return 0;
}