ruby koans shuffle what is happening

147 Views Asked by At

Can't figure out this one of the ruby koans. Maybe someone could help?The answers you seek... undefined methodto_a_shuffle' for 1..5:Range

Please meditate on the following code: /Users/nicholaskelly/koans/koans/about_dice_project.rb:12:in roll' /Users/nicholaskelly/koans/koans/about_dice_project.rb:24:intest_rolling_the_dice_returns_a_set_of_integers_between_1_and_6'`

and here is about_dice_project.rb12:

@values = (1..number).to_a_shuffle
1

There are 1 best solutions below

0
On BEST ANSWER

There is no method named to_a_shuffle. You need to apply to_a to a range then shuffle that array.

@values = (1..number).to_a.shuffle