Skip to content

Instantly share code, notes, and snippets.

@andrewrk
Created August 2, 2016 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewrk/da5e8fd944889d94cdf7eea0f24964bd to your computer and use it in GitHub Desktop.
Save andrewrk/da5e8fd944889d94cdf7eea0f24964bd to your computer and use it in GitHub Desktop.
groovebasin auto dj bug
0 = 17
1 = 48
2 = 92
3 = 130
4 = 178
5 = 187
6 = 267
8 = 302
7 = 308
9 = 361
10 = 397
11 = 474
13 = 549
12 = 563
14 = 572
15 = 608
16 = 663
17 = 690
18 = 705
19 = 781
21 = 824
20 = 859
22 = 896
23 = 960
25 = 1023
24 = 1039
26 = 1069
27 = 1088
29 = 1178
30 = 1190
28 = 1194
31 = 1259
32 = 1260
34 = 1380
33 = 1392
35 = 1395
36 = 1451
37 = 1523
38 = 1531
39 = 1616
40 = 1625
43 = 1703
41 = 1754
42 = 1775
45 = 1793
44 = 1811
46 = 1825
47 = 1843
49 = 1888
48 = 1957
50 = 2017
52 = 2035
51 = 2061
53 = 2109
54 = 2119
56 = 2178
55 = 2219
57 = 2259
58 = 2366
59 = 2382
60 = 2421
62 = 2447
63 = 2497
61 = 2507
65 = 2580
64 = 2631
66 = 2692
69 = 2750
68 = 2781
70 = 2785
67 = 2804
72 = 2866
75 = 2877
71 = 2927
74 = 2962
73 = 3002
76 = 3043
78 = 3111
77 = 3136
80 = 3156
81 = 3210
79 = 3232
82 = 3321
85 = 3349
83 = 3350
84 = 3429
86 = 3432
88 = 3509
87 = 3515
89 = 3563
90 = 3657
94 = 3674
91 = 3711
95 = 3737
92 = 3753
93 = 3791
96 = 3793
97 = 3858
98 = 3897
100 = 3997
99 = 4007
101 = 4057
103 = 4094
102 = 4130
104 = 4209
105 = 4253
107 = 4271
108 = 4271
106 = 4349
112 = 4373
109 = 4413
111 = 4449
110 = 4494
114 = 4561
115 = 4616
116 = 4627
113 = 4632
118 = 4705
119 = 4711
117 = 4747
120 = 4757
123 = 4921
122 = 4937
121 = 4949
124 = 4987
126 = 5070
127 = 5106
125 = 5109
128 = 5111
130 = 5196
129 = 5219
131 = 5259
132 = 5296
133 = 5328
136 = 5359
134 = 5360
135 = 5423
223 = 5433
139 = 5522
137 = 5524
138 = 5597
141 = 5612
140 = 5655
143 = 5669
142 = 5706
147 = 5797
145 = 5884
144 = 5943
148 = 5977
150 = 5989
149 = 5994
151 = 6009
152 = 6118
153 = 6140
146 = 6147
154 = 6156
156 = 6157
155 = 6237
158 = 6265
157 = 6301
159 = 6339
161 = 6475
162 = 6561
160 = 6566
163 = 6566
165 = 6608
167 = 6650
168 = 6711
166 = 6713
170 = 6749
164 = 6766
174 = 6789
169 = 6831
173 = 6850
171 = 6923
175 = 6980
176 = 7006
179 = 7043
172 = 7127
177 = 7155
180 = 7190
178 = 7280
183 = 7318
181 = 7338
184 = 7362
186 = 7377
182 = 7384
185 = 7386
189 = 7443
187 = 7497
190 = 7641
191 = 7679
194 = 7679
192 = 7685
188 = 7693
193 = 7796
197 = 7815
195 = 7827
198 = 7855
196 = 7954
199 = 7981
201 = 7984
200 = 8099
202 = 8101
204 = 8177
205 = 8189
207 = 8193
210 = 8296
206 = 8316
208 = 8327
203 = 8341
212 = 8460
211 = 8485
209 = 8504
215 = 8521
213 = 8591
216 = 8635
214 = 8650
218 = 8663
217 = 8731
219 = 8809
221 = 8832
222 = 8908
220 = 8921
var choices = {};
var itemCount = 50000;
for (var i = 0; i < 1000000; i += 1) {
var index = Math.floor(Math.sqrt(Math.random() * itemCount));
if (choices[index]) {
choices[index] += 1;
} else {
choices[index] = 1;
}
}
var results = Object.keys(choices);
results.sort(function(a, b) {
return choices[a] - choices[b];
});
results.forEach(function(result) {
console.log("" + result + " = " + choices[result]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment