Help for beginner

Can someone tell me why this app doesnt work? It always says “missed”
even if array include ‘shot’.

because your checkShot() param is being passed as a string. The elements
of @tab are integers. Convert “shot” to an integer before testing:

shot = shot.to_i
@u = @tab.include?(shot)

Hope that helps

  • jethrow

Thank You :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs