Created
February 23, 2018 05:21
-
-
Save jeichorn/df14167d31932cbd850c0d846738b419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function eb($retries) | |
{ | |
return mt_rand(0, (int) min(20000, (int) pow(2, $retries) * 100)); | |
} | |
for($i = 0; $i < 10; $i++) | |
{ | |
echo "Round $i\n"; | |
for($r = 0; $r < 3; $r++) | |
{ | |
echo " ".eb($r)."\n"; | |
} | |
} | |
/* | |
Round 0 | |
8 | |
177 | |
290 | |
Round 1 | |
22 | |
163 | |
275 | |
Round 2 | |
52 | |
153 | |
123 | |
Round 3 | |
95 | |
62 | |
390 | |
Round 4 | |
56 | |
107 | |
137 | |
Round 5 | |
33 | |
25 | |
309 | |
Round 6 | |
77 | |
45 | |
350 | |
Round 7 | |
40 | |
91 | |
52 | |
Round 8 | |
18 | |
26 | |
17 | |
Round 9 | |
27 | |
173 | |
62 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment