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.