title: Reading integers from console
body: <p>I am creating a "choose your own adventure" style game, and I am having trouble finding a decent solution for storing user answers (that are numbers) as integers. </p>
  
  <p>My solution:</p>
  
  <pre><code> age = IO.gets("enter age: ")
   n = String.strip(age)
   new_age = String.to_integer(n)
  </code></pre>
  
  <p>Then I have the age as an integer; however, it takes the above two functions to convert the input. There must be a better way. I tried using <code>IO.getn</code> but the problem I ran into there is that one has to specify the <code>count</code> after the <code>prompt</code>, but what if one does not know how large or small the number the user enters is? I cannot seem to find anything in detail regarding how to handle user input for console applications. </p>