Help please


#1

floats = [1.2, 3.45, 0.91, 7.727, 11.42, 482.911]

Write your code below this line!

    round_down = proc.New {|o| o.floor }

Write round_down = proc.New {|o| o.floor }your code above this line!

ints = floats.collect(&round_down)

Theres the code i inputed and its telling me it don't look right, Can someone tell me what im doing wrong? heres the link to the problem.

https://www.codecademy.com/en/courses/ruby-beginner-en-L3ZCI/1/2?curriculum_id=5059f8619189a5000201fbcb


#2

Your capitalization is off, you typed "proc.New," and what you need to type is "Proc.new." Otherwise your code should work just fine.


#3

Hi tried that and now its telling me tried to create a proc object without a block. =(


#4

Odd. I didn't encounter that error at all. This is my code exactly, and it functions the way it's supposed to. Compare yours to mine, and maybe you can spot an error.
floats = [1.2, 3.45, 0.91, 7.727, 11.42, 482.911]

round_down = Proc.new {|n| n.floor}

ints = floats.collect(&round_down)

now that I look more closely at what you posted, it looks like you put a line of code inside a comment.


#5

I spotted the error. The proc was'nt capitalized....Thank you so much.


#6

round_down = Proc.new { |x| x.floor }
the Proc should be on capital.


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.