Triggerhappy, indeed. in all my scripts I do something like this:
_tanks = [tank1,tank2,tank3,tank4,tank5,tank6,tank7,tank8,tank9,tank10]
#another
_index = random (count _tanks)
_index = _index - (_index % 1)
if (_index >= count _tanks) then {goto"another"}
(_tanks select _index) setDammage 1
I don't know exactly how the random function has been implemented, does random n generate a number >=0 and <= n; or is the range >0 and < n. I don't know so I normally use the belt and braces approach above but I have noticed that others don't.