Random string

lala = ‘Koko’
tjucka = ‘tero’
asdf = ‘jfsd’

puts <?????????????????>

What should I have instead of <?????????????????> for the program to
puts one random string either “Koko”, “tero” or “jfsd”?

Joakim Olsson wrote:

What should I have instead of <?????????????????> for the program to
puts one random string either “Koko”, “tero” or “jfsd”?

If I understand you right, you just want to print one of them variables
randomly. Without any relationship between them you cant do it (unless
there were some way of collecting all method variables).

You could always use an array, perhaps.

puts [‘Koko’, ‘tero’, ‘jfsd’][rand(3)]

Regards,
Lee