title: Node.js readline in a synchronized way? Or an asynchronous loop?
body: <p>I'm teaching programming to a kid using javascript / node.js and we were going to make a number guessing game. But I found that <code>readline</code> module only supports async, this means that the game logic can't be:</p>
  
  <pre><code>while(true){
     guess=input(); // I seem to need block here
     ans=checkGuess(guess);
     displayAns(ans);
     if(ans==0)break;
  }
  </code></pre>
  
  <p>Instead, I see that instead of a simple loop, I will need to call <code>input</code> in <code>displayAns</code> which is called by <code>checkGuess</code>, which is called by <code>input</code> - and that is definitely a ugly mess. I don't think I should be teaching the kid CPS just to solve this easy problem.</p>
  
  <p>Is there a simple and easy way for a kid to make this game in node.js? Or am I using the wrong language (maybe BASIC instead?)</p>