Experimentally add codes tag to D/T matrix

master
Tomasz Golinski 2021-04-20 20:20:19 +02:00
rodzic 23fb4f850a
commit 0a7383ba64
1 zmienionych plików z 14 dodań i 2 usunięć

Wyświetl plik

@ -421,6 +421,7 @@ int main(int argc, char** argv) {
if (!get_not_found && !get_owned) {
short count;
std::string codes;
int n;
std::cout << "<div class=\"basic_stats\">\n";
@ -740,11 +741,22 @@ int main(int argc, char** argv) {
for (int i = 2; i <= 10; i++) { // i -> diff in rows
std::cout << "<tr><th>" << i / 2.0 << "</th> ";
for (int j = 2; j <= 10; j++) { // j -> terr in cols
count = std::count_if(cc.begin(), cc.end(), [i, j](Cache c) { return (c.diff == i / 2.0 && c.terr == j / 2.0); });
// count = std::count_if(cc.begin(), cc.end(), [i, j](Cache c) { return (c.diff == i / 2.0 && c.terr == j / 2.0); });
count = 0;
codes.clear();
for (auto& c : cc) {
if (c.diff == i / 2.0 && c.terr == j / 2.0) {
count++;
codes += c.code;
codes += ' ';
}
}
codes.pop_back();
if (count == 0)
std::cout << "<td class=\"dt_zero\">" << 0 << "</td>";
else {
std::cout << "<td>" << count << "</td>";
std::cout << "<td codes=\"" << codes << "\">" << count << "</td>";
n++;
}
}