1
|
|
|
// Note: the month in a Date object is 0-indexed, i.e. new Date(2016, 11, 20) |
2
|
|
|
// is the 20th of December, 2016. Unfortunately, new Date(2016, 12, 20) will |
3
|
|
|
// not produce an error and will happily and *silently* (yes...) give you a |
4
|
|
|
// Date object representing the 20th of *January*, 2016. Nice, right?... :( |
5
|
|
|
const test_dates = [ |
6
|
|
|
(new Date(2016, 9, 19)).getTime(), |
7
|
|
|
(new Date(2016, 9, 20)).getTime(), |
8
|
|
|
(new Date(2016, 9, 21)).getTime(), |
9
|
|
|
(new Date(2016, 9, 22)).getTime(), |
10
|
|
|
(new Date(2016, 10, 1)).getTime(), |
11
|
|
|
(new Date(2016, 10, 2)).getTime(), |
12
|
|
|
(new Date(2016, 10, 3)).getTime() |
13
|
|
|
]; |
14
|
|
|
exports.test_dates = test_dates; |
15
|
|
|
|
16
|
|
|
let potd_using_default_seed = {}; |
17
|
|
|
potd_using_default_seed[test_dates[0]] = 'RZ631QL7H4'; |
18
|
|
|
potd_using_default_seed[test_dates[1]] = '730B78VQPT'; |
19
|
|
|
potd_using_default_seed[test_dates[2]] = '13UITQJ132'; |
20
|
|
|
potd_using_default_seed[test_dates[3]] = '8722S2N0T7'; |
21
|
|
|
potd_using_default_seed[test_dates[4]] = 'R6HBPKY66J'; |
22
|
|
|
potd_using_default_seed[test_dates[5]] = 'CTXRK3NV0D'; |
23
|
|
|
potd_using_default_seed[test_dates[6]] = 'N776Z9GSO9'; |
24
|
|
|
exports.potd_using_default_seed = potd_using_default_seed; |
25
|
|
|
|
26
|
|
|
exports.custom_seed = 'ABCDEFGHIJ'; |
27
|
|
|
|
28
|
|
|
let potd_using_custom_seed = {}; |
29
|
|
|
potd_using_custom_seed[test_dates[0]] = 'ZJC551QLMO'; |
30
|
|
|
potd_using_custom_seed[test_dates[1]] = 'BZLLEEPPKS'; |
31
|
|
|
potd_using_custom_seed[test_dates[2]] = '0H0WEOI4WQ'; |
32
|
|
|
potd_using_custom_seed[test_dates[3]] = 'T5F0OJ2RKM'; |
33
|
|
|
potd_using_custom_seed[test_dates[4]] = 'SJ3LQ46SN8'; |
34
|
|
|
potd_using_custom_seed[test_dates[5]] = '1FKXJAUR1Q'; |
35
|
|
|
potd_using_custom_seed[test_dates[6]] = 'JCBCYHOQBP'; |
36
|
|
|
exports.potd_using_custom_seed = potd_using_custom_seed; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* list 1 is always the same for both default and custom seeds |
40
|
|
|
* because it only depends on the date. |
41
|
|
|
*/ |
42
|
|
|
let test_list1 = {}; |
43
|
|
|
test_list1[test_dates[0]] = [ 29, 14, 32, 29, 24, 19, 7, 21 ]; |
44
|
|
|
test_list1[test_dates[1]] = [ 23, 32, 24, 29, 29, 20, 6, 26 ]; |
45
|
|
|
test_list1[test_dates[2]] = [ 14, 29, 10, 21, 29, 21, 5, 31 ]; |
46
|
|
|
test_list1[test_dates[3]] = [ 34, 27, 16, 23, 30, 22, 4, 0 ]; |
47
|
|
|
test_list1[test_dates[4]] = [ 13, 14, 27, 32, 10, 1, 26, 6 ]; |
48
|
|
|
test_list1[test_dates[5]] = [ 29, 14, 32, 29, 24, 2, 25, 12 ]; |
49
|
|
|
test_list1[test_dates[6]] = [ 23, 32, 24, 29, 29, 3, 24, 18 ]; |
50
|
|
|
exports.test_list1 = test_list1; |
51
|
|
|
|
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Data for default seed lists. |
55
|
|
|
*/ |
56
|
|
|
|
57
|
|
|
exports.test_list2_using_default_seed = [ 5, 8, 11, 2, 3, 5, 32, 0 ]; |
58
|
|
|
|
59
|
|
|
let test_list3_using_default_seed = {}; |
60
|
|
|
test_list3_using_default_seed[test_dates[0]] = [ 34, 22, 7, 31, 27, 24, 3, 21, 25, 1 ]; |
61
|
|
|
test_list3_using_default_seed[test_dates[1]] = [ 28, 4, 35, 31, 32, 25, 2, 26, 3, 9 ]; |
62
|
|
|
test_list3_using_default_seed[test_dates[2]] = [ 19, 1, 21, 23, 32, 26, 1, 31, 10, 16 ]; |
63
|
|
|
test_list3_using_default_seed[test_dates[3]] = [ 3, 35, 27, 25, 33, 27, 0, 0, 6, 0 ]; |
64
|
|
|
test_list3_using_default_seed[test_dates[4]] = [ 18, 22, 2, 34, 13, 6, 22, 6, 15, 9 ]; |
65
|
|
|
test_list3_using_default_seed[test_dates[5]] = [ 34, 22, 7, 31, 27, 7, 21, 12, 17, 25 ]; |
66
|
|
|
test_list3_using_default_seed[test_dates[6]] = [ 28, 4, 35, 31, 32, 8, 20, 18, 32, 4 ]; |
67
|
|
|
exports.test_list3_using_default_seed = test_list3_using_default_seed; |
68
|
|
|
|
69
|
|
|
let test_list4_using_default_seed = {}; |
70
|
|
|
test_list4_using_default_seed[test_dates[0]] = [ 22, 27, 31, 1, 34, 21, 25, 7, 24, 3 ]; |
71
|
|
|
test_list4_using_default_seed[test_dates[1]] = [ 2, 31, 25, 9, 4, 3, 35, 26, 32, 28 ]; |
72
|
|
|
test_list4_using_default_seed[test_dates[2]] = [ 32, 31, 19, 16, 26, 21, 23, 1, 10, 1 ]; |
73
|
|
|
test_list4_using_default_seed[test_dates[3]] = [ 3, 35, 27, 0, 25, 33, 27, 0, 0, 6 ]; |
74
|
|
|
test_list4_using_default_seed[test_dates[4]] = [ 22, 34, 6, 9, 22, 15, 2, 6, 13, 18 ]; |
75
|
|
|
test_list4_using_default_seed[test_dates[5]] = [ 7, 21, 22, 25, 17, 34, 27, 31, 7, 12 ]; |
76
|
|
|
test_list4_using_default_seed[test_dates[6]] = [ 18, 35, 32, 4, 32, 4, 20, 28, 31, 8 ]; |
77
|
|
|
exports.test_list4_using_default_seed = test_list4_using_default_seed; |
78
|
|
|
|
79
|
|
|
let test_list5_using_default_seed = {}; |
80
|
|
|
test_list5_using_default_seed[test_dates[0]] = [ 27, 35, 6, 3, 1, 26, 21, 7, 17, 4 ]; |
81
|
|
|
test_list5_using_default_seed[test_dates[1]] = [ 7, 3, 0, 11, 7, 8, 31, 26, 25, 29 ]; |
82
|
|
|
test_list5_using_default_seed[test_dates[2]] = [ 1, 3, 30, 18, 29, 26, 19, 1, 3, 2 ]; |
83
|
|
|
test_list5_using_default_seed[test_dates[3]] = [ 8, 7, 2, 2, 28, 2, 23, 0, 29, 7 ]; |
84
|
|
|
test_list5_using_default_seed[test_dates[4]] = [ 27, 6, 17, 11, 25, 20, 34, 6, 6, 19 ]; |
85
|
|
|
test_list5_using_default_seed[test_dates[5]] = [ 12, 29, 33, 27, 20, 3, 23, 31, 0, 13 ]; |
86
|
|
|
test_list5_using_default_seed[test_dates[6]] = [ 23, 7, 7, 6, 35, 9, 16, 28, 24, 9 ]; |
87
|
|
|
exports.test_list5_using_default_seed = test_list5_using_default_seed; |
88
|
|
|
|
89
|
|
|
let test_num8_using_default_seed = {}; |
90
|
|
|
test_num8_using_default_seed[test_dates[0]] = 1; |
91
|
|
|
test_num8_using_default_seed[test_dates[1]] = 3; |
92
|
|
|
test_num8_using_default_seed[test_dates[2]] = 4; |
93
|
|
|
test_num8_using_default_seed[test_dates[3]] = 0; |
94
|
|
|
test_num8_using_default_seed[test_dates[4]] = 3; |
95
|
|
|
test_num8_using_default_seed[test_dates[5]] = 5; |
96
|
|
|
test_num8_using_default_seed[test_dates[6]] = 2; |
97
|
|
|
exports.test_num8_using_default_seed = test_num8_using_default_seed; |
98
|
|
|
|
99
|
|
|
|
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Data for custom seed lists. |
103
|
|
|
*/ |
104
|
|
|
|
105
|
|
|
exports.test_list2_using_custom_seed = [ 29, 30, 31, 32, 33, 34, 35, 0 ]; |
106
|
|
|
|
107
|
|
|
let test_list3_using_custom_seed = {}; |
108
|
|
|
test_list3_using_custom_seed[test_dates[0]] = [ 22, 8, 27, 25, 21, 17, 6, 21, 3, 9 ]; |
109
|
|
|
test_list3_using_custom_seed[test_dates[1]] = [ 16, 26, 19, 25, 26, 18, 5, 26, 17, 25 ]; |
110
|
|
|
test_list3_using_custom_seed[test_dates[2]] = [ 7, 23, 5, 17, 26, 19, 4, 31, 24, 0 ]; |
111
|
|
|
test_list3_using_custom_seed[test_dates[3]] = [ 27, 21, 11, 19, 27, 20, 3, 0, 20, 4 ]; |
112
|
|
|
test_list3_using_custom_seed[test_dates[4]] = [ 6, 8, 22, 28, 7, 35, 25, 6, 29, 25 ]; |
113
|
|
|
test_list3_using_custom_seed[test_dates[5]] = [ 22, 8, 27, 25, 21, 0, 24, 12, 31, 1 ]; |
114
|
|
|
test_list3_using_custom_seed[test_dates[6]] = [ 16, 26, 19, 25, 26, 1, 23, 18, 10, 16 ]; |
115
|
|
|
exports.test_list3_using_custom_seed = test_list3_using_custom_seed; |
116
|
|
|
|
117
|
|
|
let test_list4_using_custom_seed = {}; |
118
|
|
|
test_list4_using_custom_seed[test_dates[0]] = [ 6, 25, 17, 9, 8, 3, 27, 21, 21, 22 ]; |
119
|
|
|
test_list4_using_custom_seed[test_dates[1]] = [ 18, 5, 26, 25, 17, 16, 26, 25, 19, 26 ]; |
120
|
|
|
test_list4_using_custom_seed[test_dates[2]] = [ 7, 23, 5, 0, 17, 26, 19, 4, 31, 24 ]; |
121
|
|
|
test_list4_using_custom_seed[test_dates[3]] = [ 0, 11, 20, 4, 27, 21, 3, 27, 19, 20 ]; |
122
|
|
|
test_list4_using_custom_seed[test_dates[4]] = [ 35, 25, 8, 25, 29, 6, 7, 28, 22, 6 ]; |
123
|
|
|
test_list4_using_custom_seed[test_dates[5]] = [ 8, 21, 25, 1, 22, 12, 31, 27, 0, 24 ]; |
124
|
|
|
test_list4_using_custom_seed[test_dates[6]] = [ 26, 18, 16, 16, 1, 19, 25, 26, 10, 23 ]; |
125
|
|
|
exports.test_list4_using_custom_seed = test_list4_using_custom_seed; |
126
|
|
|
|
127
|
|
|
let test_list5_using_custom_seed = {}; |
128
|
|
|
test_list5_using_custom_seed[test_dates[0]] = [ 35, 19, 12, 5, 5, 1, 26, 21, 22, 24 ]; |
129
|
|
|
test_list5_using_custom_seed[test_dates[1]] = [ 11, 35, 21, 21, 14, 14, 25, 25, 20, 28 ]; |
130
|
|
|
test_list5_using_custom_seed[test_dates[2]] = [ 0, 17, 0, 32, 14, 24, 18, 4, 32, 26 ]; |
131
|
|
|
test_list5_using_custom_seed[test_dates[3]] = [ 29, 5, 15, 0, 24, 19, 2, 27, 20, 22 ]; |
132
|
|
|
test_list5_using_custom_seed[test_dates[4]] = [ 28, 19, 3, 21, 26, 4, 6, 28, 23, 8 ]; |
133
|
|
|
test_list5_using_custom_seed[test_dates[5]] = [ 1, 15, 20, 33, 19, 10, 30, 27, 1, 26 ]; |
134
|
|
|
test_list5_using_custom_seed[test_dates[6]] = [ 19, 12, 11, 12, 34, 17, 24, 26, 11, 25 ]; |
135
|
|
|
exports.test_list5_using_custom_seed = test_list5_using_custom_seed; |
136
|
|
|
|
137
|
|
|
let test_num8_using_custom_seed = {}; |
138
|
|
|
test_num8_using_custom_seed[test_dates[0]] = 3; |
139
|
|
|
test_num8_using_custom_seed[test_dates[1]] = 5; |
140
|
|
|
test_num8_using_custom_seed[test_dates[2]] = 0; |
141
|
|
|
test_num8_using_custom_seed[test_dates[3]] = 2; |
142
|
|
|
test_num8_using_custom_seed[test_dates[4]] = 5; |
143
|
|
|
test_num8_using_custom_seed[test_dates[5]] = 1; |
144
|
|
|
test_num8_using_custom_seed[test_dates[6]] = 4; |
145
|
|
|
exports.test_num8_using_custom_seed = test_num8_using_custom_seed; |
146
|
|
|
|