ruby - Combining rand() numbers -


i'm attempting combine few random numbers. numbers supposed represent dice.

for example, want roll dice 5 times , following results: 4 2 1 4 6.
these individual numbers want combine 42146.

this might simple question apologize i'm still new ruby.

i'm generating numbers between [1,6] through this:

number = 1 + rand(6) 

1.upto(5).map { rand(1..6) }.join.to_i 

Comments