# Hangman Help

**URL:** <https://www.ruby-forum.com/t/hangman-help/179693>\
**Category:** Ruby\
**Created:** [December 2, 2009, 4:48am UTC](https://www.ruby-forum.com/t/hangman-help/179693 "2009-12-02T04:48:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jovijunki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jovijunki](https://www.ruby-forum.com/u/jovijunki)\
**Post date:** [December 2, 2009, 4:48am UTC](https://www.ruby-forum.com/t/hangman-help/179693/1 "2009-12-02T04:48:05Z")

</div>

How do I print the dashes and letters to represent the word to be  
guessed.

The letters guessed by the player are properly put into the respective  
arrays.

Whatever I try to do I either get all dashes back or the whole word back

\_ \_ \_ \_ or f i s h, never f \_ \_ h

My arrays are @correct\_guesses and @incorrect\_guesses

How do I get it to say puts @correct\_guesses in the right blanks and if  
the guess is @incorrect\_guesses to leave it blank

---

<div class="post-metadata">

**Author:** ![jovijunki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jovijunki](https://www.ruby-forum.com/u/jovijunki)\
**Post date:** [December 2, 2009, 5:10am UTC](https://www.ruby-forum.com/t/hangman-help/179693/2 "2009-12-02T05:10:37Z")

</div>

On Tue, Dec 1, 2009 at 10:48 PM, Dylan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Whatever I try to do I either get all dashes back or the whole word back
> 
> \_ \_ \_ \_ or f i s h, never f \_ \_ h
> 
> My arrays are @correct\_guesses and @incorrect\_guesses
> 
> How do I get it to say puts @correct\_guesses in the right blanks and if  
> the guess is @incorrect\_guesses to leave it blank

It might help us help you if you provide a sample of the code you are  
trying that doesn’t work. 🙂

Meanwhile, checkout:  
[http://ruby-doc.org/core/classes/String.html#M000830](http://ruby-doc.org/core/classes/String.html#M000830)
