diff --git a/geostat.cpp b/geostat.cpp index 110d730..f5cf1a1 100644 --- a/geostat.cpp +++ b/geostat.cpp @@ -230,6 +230,7 @@ int main(int argc, char** argv) { Date_Caches sorted_caches_by_hidden; Sorted_Caches caches_by_fav; Sorted_Caches caches_by_fav_perc; + Sorted_Caches caches_by_finds; Caches fcc; std::tm tmp; @@ -245,9 +246,11 @@ int main(int argc, char** argv) { sorted_caches_by_hidden.insert({ std::mktime(&tmp), &i }); caches_by_fav.push_back(&i); caches_by_fav_perc.push_back(&i); + caches_by_finds.push_back(&i); } std::sort(caches_by_fav.begin(), caches_by_fav.end(), [&](const Cache* a, const Cache* b) { return a->fav > b->fav; }); std::sort(caches_by_fav_perc.begin(), caches_by_fav_perc.end(), [&](const Cache* a, const Cache* b) { return 1.0 * a->fav / a->founds > 1.0 * b->fav / b-> founds; }); + std::sort(caches_by_finds.begin(), caches_by_finds.end(), [&](const Cache* a, const Cache* b) { return a->founds > b->founds; }); std::cout << "\n"; std::cout << "\n"; @@ -424,6 +427,7 @@ int main(int argc, char** argv) { std::cout << "\n"; std::cout << ""; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << "\n"; @@ -431,6 +435,7 @@ int main(int argc, char** argv) { for (auto i = sorted_caches_by_hidden.begin(); i != sorted_caches_by_hidden.end(); i++) { std::cout << " "; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << "\n"; @@ -445,6 +450,7 @@ int main(int argc, char** argv) { std::cout << "
CacheTypeDate hiddenDate found
" << n << "" << "second->link() << "\">" << i->second->safe_name() << " (" << i->second->code << ")" << "" << i->second->type << "" << i->second->date_hidden << "" << i->second->date << "
\n"; std::cout << ""; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << "\n"; @@ -452,6 +458,7 @@ int main(int argc, char** argv) { for (auto i = sorted_caches_by_hidden.rbegin(); i != sorted_caches_by_hidden.rend(); i++) { std::cout << " "; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << "\n"; @@ -466,6 +473,7 @@ int main(int argc, char** argv) { std::cout << "
CacheTypeDate hiddenDate found
" << n << "" << "second->link() << "\">" << i->second->safe_name() << " (" << i->second->code << ")" << "" << i->second->type << "" << i->second->date_hidden << "" << i->second->date << "
\n"; std::cout << ""; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << ""; @@ -474,6 +482,7 @@ int main(int argc, char** argv) { for (auto i : caches_by_fav) { std::cout << " "; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << ""; @@ -489,6 +498,7 @@ int main(int argc, char** argv) { std::cout << "
CacheTypeRec.Finds%
" << n << "" << "link() << "\">" << i->safe_name() << " (" << i->code << ")" << "" << i->type << "" << i->fav << "" << i->founds << "" << std::setprecision(3) << 100.0 * i->fav / i->founds << "%
\n"; std::cout << ""; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << ""; @@ -497,6 +507,7 @@ int main(int argc, char** argv) { for (auto i : caches_by_fav_perc) { std::cout << " "; std::cout << ""; + std::cout << ""; std::cout << ""; std::cout << ""; std::cout << ""; @@ -506,6 +517,52 @@ int main(int argc, char** argv) { } std::cout << "
CacheTypeRec.Finds%
" << n << "" << "link() << "\">" << i->safe_name() << " (" << i->code << ")" << "" << i->type << "" << i->fav << "" << i->founds << "" << std::setprecision(3) << 100.0 * i->fav / i->founds << "%
\n"; + n = 1; + + std::cout << "

Caches with most finds

\n"; + std::cout << "\n"; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << "\n"; + + for (auto i : caches_by_finds) { + std::cout << " "; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << "\n"; + n++; + if (n > LIST_MAX) break; + } + std::cout << "
CacheTypeDate hiddenFinds
" << n << "" << "link() << "\">" << i->safe_name() << " (" << i->code << ")" << "" << i->type << "" << i->date_hidden << "" << i->founds << "
\n"; + + n = 1; + + std::cout << "

Caches with least finds

\n"; + std::cout << "\n"; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << "\n"; + + for (auto i = caches_by_finds.rbegin(); i != caches_by_finds.rend(); i++) { + std::cout << " "; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << ""; + std::cout << "\n"; + n++; + if (n > LIST_MAX) break; + } + std::cout << "
CacheTypeDate hiddenFinds
" << n << "" << "link() << "\">" << (*i)->safe_name() << " (" << (*i)->code << ")" << "" << (*i)->type << "" << (*i)->date_hidden << "" << (*i)->founds << "
\n"; + short y_min = std::min_element(cc.begin(), cc.end(), [&](const Cache& a, const Cache& b) { return a.date_hidden_tm.tm_year < b.date_hidden_tm.tm_year; })->date_hidden_tm.tm_year; short y_max = std::max_element(cc.begin(), cc.end(), [&](const Cache& a, const Cache& b) { return a.date_hidden_tm.tm_year < b.date_hidden_tm.tm_year; })->date_hidden_tm.tm_year;