mistake in the intro to Ruby course?

Asked by ahillelt about 1 year ago

I may be wrong here but in "10. Example: a guessing game!", the code won't work because one is a string and one isn't? maybe i'm wrong but should you add:

' secret_number = secret_number.to_s

'

Granted you are no longer working with integers, however otherwise it seems to not work. Is the input considered a string?

1 response

  • steve says

    Yep! This is technically a bug in the tutorial; some people really enjoyed figuring it out, like a puzzle, though.

    The input is considered a string. It's the '42' that's not. Try 42.to_s or using to_i on the input.