I was trying to make a script for the hacking challenge1. When I was at the basic level that is i want the user to enter a statement and then I can store it as array but thee problem is that how long I inputs a string, the size of the array is always 1 which should not.Can anyone point a mistake in the script that I can't see? If you are able to find the mistake then plz post, I will be very grateful.The code isprint "Enter any string: "
user_input=gets.chomp
user = []
user.push(user_input.scan(/\w+/).inspect)
puts user.length