This is one fool-proof technique to turn a number returned from the random command into a whole integer:
_num = random 10
_num = _num - (_num mod 1)
Now _num will contain a whole integer between 0 and 10, and then you can compare it like this:
?(_num == #) : foo
? (_num == ##) : bar
Start off with that, the rest I can't help you with since I'm not able to test anything myself, as on the girlfriends comp and stuff