forked from errorcodexero/standing_predictor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrand.cpp
More file actions
73 lines (57 loc) · 1.26 KB
/
Copy pathrand.cpp
File metadata and controls
73 lines (57 loc) · 1.26 KB
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
71
72
73
#include "rand.h"
#include "../tba/data.h"
tba::Team_key rand(tba::Team_key const*);
tba::Event_key rand(tba::Event_key const*);
auto options(tba::Award_type const*){
return std::array{
#define X(A,B) tba::Award_type::A,
TBA_AWARD_TYPES(X)
#undef X
};
}
tba::Award_type rand(tba::Award_type const* x){
return choose(options(x));
}
bool rand(bool const*){
return rand()%2;
}
short rand(short const*){
return rand();
}
unsigned short rand(unsigned short const*){
return rand();
}
int rand(int const*){
return rand();
}
unsigned rand(unsigned const*){
return (unsigned)rand();
}
size_t rand(size_t const*){
return rand();
}
double rand(double const*){
return rand();
}
std::string rand(std::string const*){
return "rand_string";
}
template<typename T>
T rand(T const*);
std::chrono::year rand(std::chrono::year const*){
return std::chrono::year(rand()%3000);
}
std::chrono::month rand(std::chrono::month const*){
return std::chrono::month(1+rand()%12);
}
std::chrono::day rand(std::chrono::day const*){
return std::chrono::day(1+rand()%28);
}
std::chrono::year_month_day rand(std::chrono::year_month_day const*){
std::chrono::year_month_day r{
rand((std::chrono::year*)0),
rand((std::chrono::month*)0),
rand((std::chrono::day*)0)
};
return r;
}