-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.cpp
57 lines (51 loc) · 878 Bytes
/
core.cpp
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
#include "core.h"
static std::string_view keys[] = {
"Kez",
"Kex",
"Kye",
"Koy",
"Keem",
"Kyez",
"Keh",
"Kiy",
"Kae",
"Kwey",
};
static std::string_view values[] = {
"Vylue",
"Vaulue",
"Vellue",
"Vyluxe",
"Velluxe",
"Vylise",
"Vellise",
"Vylume",
"Vellume",
"Vyluxe",
};
void
FlibberCollection::flibber()
{
myFlibbers.push_back(makeFlibber());
}
std::string
FlibberCollection::toString(uint8_t tabs) const
{
if (myFlibbers.size() == 0)
return {};
std::string tab;
for (uint8_t i = 0; i < tabs; ++i)
tab += '\t';
std::string res = tab + "flibbers:\n";
for (const Flibber& fli : myFlibbers)
res += tab + '\t' + fli.myKey + ": " + fli.myValue + '\n';
return res;
}
Flibber
makeFlibber()
{
Flibber f;
f.myKey = keys[rand() % (sizeof(keys) / sizeof(keys[0]))];
f.myValue = values[rand() % (sizeof(values) / sizeof(values[0]))];
return f;
}