def pass_growing_season
self.age += 1
if self.age >= 6
harvested_oranges << Orange.new #NEED 100 - 300 !!!
end
if self.height < 25
self.height += 2.5
end
end
I am trying to initialize an Orange class that is defined in another file. Right now I have one new object getting shoveled into an empty array. I want to create a random number them between 100 and 300. So far I have tried
harvested_oranges = Orange.new(rand(100.300))
but I get an error telling me the Orange.new is taking an argument and isn't supposed to... must not be the right plan... any help would be great!
Aucun commentaire:
Enregistrer un commentaire