Good enough approximation
Replace this:
my
$i
=
int
(
rand
(
100
) );