How to have ruby pick randomly from an array : <p>Im pretty new to programming and I'm trying to make a basic rock paper scissors program.</p>

<p>I've already made this program using 1 = rock, 2 = paper, 3 = scissors. but now I want to try doing it with actual words instead of numbers. How can I make ruby choose randomly from my array, mine?</p>

<p>Thanks!</p>

<pre><code>mine = ["Rock", "Paper", "Scissors"]
mine.sample(1 + rand(mine.count))
puts 'Write your choice, Rock, Paper, or Scissors'
yours = gets.chomp.to_s
if yours == "Rock"
    puts 'Your choice is Rock'


elsif yours == "Paper"
    puts 'Your choice is Paper'

else yours == "Scissors"
    puts 'Your choice is Scissors'

end
puts "--------------------------"
if mine == "Rock"
    puts 'Computer: My choice is Rock'


elsif mine == "Paper"
    puts 'Computer: My choice is Paper'

else mine == "Scissors"
    puts 'Computer: My choice is Scissors'

end


print 'Computer: My choice was: '
print mine
puts

if mine == "Rock" &amp;&amp; yours == "Paper"
    puts "==========="
    puts "Paper Wins!"
    puts "==========="
elsif mine == "Paper" &amp;&amp; yours == "Rock"
    puts "==========="
    puts "Paper Wins!"
    puts "==========="
elsif mine == "Paper" &amp;&amp; yours == "Scissors"
    puts "=============="
    puts "Scissors Wins!"
    puts "=============="
elsif mine == "Scissors" &amp;&amp; yours == "Paper"
    puts "=============="
    puts "Scissors Wins!"
    puts "=============="
elsif mine == "Scissors" &amp;&amp; yours == "Rock"
    puts "=========="
    puts "Rock Wins!"
    puts "=========="
elsif  mine == "Rock" &amp;&amp; yours == "Scissors"
    puts "=============="
    puts "Rock Wins!"
    puts "=============="
else
    puts "======================"
    puts "It's a tie! TRY AGAIN!"
    puts "======================"
end
</code></pre>
