Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Hangman Help

Reply
Thread Tools

Hangman Help

 
 
Dylan Rodriguez
Guest
Posts: n/a
 
      12-02-2009
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
brabuhr@gmail.com
Guest
Posts: n/a
 
      12-02-2009
On Tue, Dec 1, 2009 at 10:48 PM, Dylan Rodriguez <> wr=
ote:
> Whatever I try to do I either get all dashes back or the whole word back
>
> _ _ _ _ =A0or 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hangman program stuck.. nid help. kaka_hunter@hotmail.com C++ 3 10-16-2007 07:13 PM
Hangman Game tigrfire C Programming 5 11-29-2005 03:51 AM
hangman Salim Java 2 03-08-2005 09:28 AM
hangman Salim Java 1 03-07-2005 06:22 PM
ServletExec hangman.jsp example problem Matthew Java 2 12-08-2004 09:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57