Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

input must be integer in ruby

print "Think of a number "

while user_input = gets.to_i
  if user_input.is_a? Integer
    puts "your number is #{user_input}"
    break
  else
    print "Think of a number "
  end 
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #integer #ruby
ADD COMMENT
Topic
Name
5+3 =