From: Cheryl Cepak Date: 2008-12-02T13:26:31+09:00 Subject: Re: Not a Ruby person but trying to help a newbie Cheryl Cepak wrote: > Hi there > > I am a C++ person but trying to help a friend using Ruby. > He is supposed to ask for user input by using an index number to change > the letter of a word given, like say "dog". So the user it asked to > enter the index number, lets say 0 is entered by the user, and he then > asks the user to put a new letter in (letter is a variable), then he > wants to change the index of 0 which is the "D" to a "C" (where c was > put in by the user). > > Can anyone help with this? How to do it please? > > Cheryl Here is what he has so far: student_name = 'John Wallace' puts student_name + "'s WordWarp Game!" require 'zlib' dictionary = Zlib::GzipReader.open('words3-8.gz').read().split() current_word = 'dog' target_word = 'cat' puts puts current_word.to_s + ' => ' + target_word.to_s puts 'What is the index of the letter you wish to change?' index = gets puts 'What letter do you wish to insert?' letter = gets temp_word = current_word.clone() puts temp_word -- Posted via http://www.ruby-forum.com/.