From: Isaac Toothyxdip Date: 2008-02-21T07:36:05+09:00 Subject: Re: displaying user inputed arrays The gets.chomp.split(" ") works for checking the amount of words but now for my code it doesnt return the words places = ['first', 'second', 'third', 'fourth', 'fifth'] puts 'Please enter 5 words on the same line with spaces then press enter:' answered = false while not answered input_words = gets.chomp.split(" ") if input_words.length > 5 puts "Please type in FIVE words no more: " else answered = true end end input_words.each_with_index do |word, i| puts "To view a word you picked type:\n 1: first word\n 2: second word\n 3: third word\n 4: fourth word\n 5: fifth word" answered = false while not answered num_answer = gets.chomp case num_answer[0] when '1'[0] i = 0 answered = true when '2'[0] i = 1 answered = true when '3'[0] i = 2 answered = true when '4'[0] i = 3 answered = true when '5'[0] i = 4 answered = true else puts "Try again...enter a number 1 - 5 to see one of the words you typed" end end puts "The %s word you entered was %s" % [places[i], word[i]] end it just returns "The (place) word you entered was" and thats it i think its because now that its not in the brackets that when i do word[i] its not returning the array word[whatever] -- Posted via http://www.ruby-forum.com/.