3 ms·
There is an equiprobability of winning/losing/draw. Your code is erroneous. You do a +1 to the random number you generate giving you 1, 2, 3. You then use that
by Monkeyget 12y ago
There is an equiprobability of winning/losing/draw. Your code is erroneous.
You do a +1 to the random number you generate giving you 1, 2, 3. You then use that number to access an array with indexes [0, 1, 2]. You end with an undefined which screws your results.
- andyhmltn 12y agoWell if that was the case, then one result would always have 0. The indexes are used to find what something wins against