1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-18 11:58:07 +00:00

racing:: speedometer

This commit is contained in:
Zeno Rogue
2019-06-01 20:03:03 +02:00
parent 3d08d359ee
commit d864c8cc1e
4 changed files with 13 additions and 2 deletions

View File

@@ -34,6 +34,13 @@ string fts(ld x, int prec) {
return ss.str();
}
string fts_fixed(ld x, int prec) {
std::stringstream ss;
ss.precision(prec);
ss << std::fixed << x;
return ss.str();
}
bool scan(fhstream& hs, int& i) { return fscanf(hs.f, "%d", &i) == 1; }
bool scan(fhstream& hs, color_t& c) { return fscanf(hs.f, "%x", &c) == 1; }
bool scan(fhstream& hs, ld& x) { return fscanf(hs.f, "%lf", &x) == 1; }