As Online says, $rand() is fixed in newer versions (I'm unsure precisely when,
versions.txt only mentions changes in v6.1 although I thought I'd seen it still broken since then - perhaps not).
As an example I used this alias
bmr {
; Usage: /bmr <sample-size>
var %i = $$int($1), %r1 = 0, %r2 = 0, %r3 = 0
while %i {
inc $+(%, r, $rand(1,3))
dec %i
}
echo -a $!rand(): 041: %r1 $+ ; 042: %r2 $+ ; 043: %r3 $+ ;
}
Using
/bmr 10000 I got:
$rand(): [color:red]1: 3329;
2: 3329;
3: 3342;[/color]
which in a bugged version would have shown
2 to return half as often as
1 or
3.