Skip to content

Instantly share code, notes, and snippets.

@soner8
Created March 13, 2018 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soner8/31941beedf202a0397d2c9995eb2f852 to your computer and use it in GitHub Desktop.
Save soner8/31941beedf202a0397d2c9995eb2f852 to your computer and use it in GitHub Desktop.
age.js
process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log('How old r u ? ')
process.stdin.on('data', (number) => {
let annee = 2018 - number;
if (1 <= number && number <= 99) {
console.log('Vous êtes nés en :' + annee);
process.exit()
}
(number = [/a-z/])
console.log("Daaamn");
process.exit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment