# Help for beginner

**URL:** <https://www.ruby-forum.com/t/help-for-beginner/197606>\
**Category:** Ruby\
**Created:** [October 17, 2010, 4:17am UTC](https://www.ruby-forum.com/t/help-for-beginner/197606 "2010-10-17T04:17:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [October 17, 2010, 4:17am UTC](https://www.ruby-forum.com/t/help-for-beginner/197606/1 "2010-10-17T04:17:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pawe\_p](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pawe\_p](https://www.ruby-forum.com/u/pawe_p)\
**Post date:** [October 17, 2010, 5:21am UTC](https://www.ruby-forum.com/t/help-for-beginner/197606/2 "2010-10-17T05:21:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pawe\_p](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pawe\_p](https://www.ruby-forum.com/u/pawe_p)\
**Post date:** [October 17, 2010, 10:45am UTC](https://www.ruby-forum.com/t/help-for-beginner/197606/3 "2010-10-17T10:45:19Z")

</div>

Thank You 🙂
