Monday 7 December 2015

Is there an easy way to accept input from users & store in vars in command line apps?

If I wanted to write a coin toss app in the command line, with PHP for example, it would be something like this:echo "Enter Heads or Tails please: "; $chosenSide = fgets(STDIN);And boom, I can work with the $chosenSide variable.Is there anything similar to this? From what i've seen it looks quite painful to get any sort of equivalent with Node.Or would it be easier to just not do command line apps and work straight in the browser? Trying to do "Code challenge" type things that sometimes require users to enter input multiple times.

Submitted December 08, 2015 at 03:32AM by fastpenguin91

No comments:

Post a Comment