Matt Beckley wrote:
> Now I wanna take my array and apply a
> method to it that will check which elements are less 21 but more then
> 10. For you math types 10<x<21.
>
> a = nums1.reject {|x| x<10 && x>21}

What you want is:

a = nums.find_all { |n| n > 10 && n < 21 }

OR using Range

a = nums.find_all { |n| (11..20) === n }

Generating random number

>   nums << rand(100)

rand(100) will generate a random number from 0 to 99,
what you want to do is

nums << rand(100)+1  # random number from 1 to 100


> Thanks,
> Matt


-- 
Kind Regards,
Rajinder Yadav

http://DevMentor.org

Do Good! - Share Freely, Enrich and Empower people to Transform their lives.