BeBot - An Anarchy Online and Age Of Conan chat automaton
General => Feedback and Suggestions => Topic started by: xdave78 on June 12, 2009, 05:52:04 pm
-
Hey,
there must be sth wrong with the flip-command. It always returns Heads!
Regards
-
Yep, confirmed.
15 rolls on the current version all resulted in heads.
To fix it change this line in Roll.php
$result['result'] = ((rand(1, 2)) ? 'heads' : 'tails');
to
$result['result'] = ((rand(0, 1)) ? 'heads' : 'tails');
The random number generator seems a bit skewed though.
A test of 15 runs with the 'fix' produced 11 heads to 4 tails.
-
what happened is rand was told to roll the number 1 or 2
the ? is a way of doing if() of wats before, 1 and 2 would be true so both output head
0 and 1 howeva wont the 0 will register as false and give tails