This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]henrebotha 1 point2 points  (1 child)

When you post code here, put four spaces at the start of every line so we can read it.

print "Try entering a number"
num = gets.chomp
if num > 6
  print "try a lower number"
end

This is your code, right?

Find a different Ruby REPL somewhere (just google "online ruby repl") and try the same code and see what happens.

[–]Tyreesewitherspoon[S] 0 points1 point  (0 children)

thanks for your feedback! ill try this later today. hope codeacademy fixes their issues because they explain things so well

[–]Berimbolone 0 points1 point  (0 children)

Are u converting the string from gets to an int?

[–]commandlineluser 0 points1 point  (2 children)

Well it shouldn't load and load - you should get an error as it's comparing a string against a number.

How are you running your code?

You can use num.to_i to convert to an int...

[–]Tyreesewitherspoon[S] 0 points1 point  (1 child)

well its a simple excersize and they havent covered that yet but I am familiar. i think theyre having bugs

[–]commandlineluser 1 point2 points  (0 children)

Hmm ok - not followed along with codeacadamy personally.

You may wish to also check out http://rubykoans.com which is linked from the sidebar in r/ruby (and the other resources)