|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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"? -- Posted via http://www.ruby-forum.com/. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 -- Posted via http://www.ruby-forum.com/. |
|
![]() |
| Outils de la discussion | |
|
|