Random code using an array