Created
March 20, 2017 09:46
-
-
Save gregoire-bessagnet/8e10943351ea2a816f0361a93c1225c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.stdin.resume() | |
process.stdin.setEncoding('utf8') | |
// console.log('What\'s your name ? ') | |
// process.stdin.on('data', (text) => { | |
// console.log('Hello ' + text) | |
// process.exit() | |
// }) | |
var age = console.log("How old are you ?"); | |
process.stdin.on('data', (agedonne) => { | |
if (agedonne > 99) { | |
console.log("You seems to be dead, perhaps...") | |
} | |
else if (isNaN(agedonne)) { | |
console.log("lol") | |
} | |
else { | |
var today = new Date().getFullYear(); | |
var anneedenaissance = today - agedonne; | |
console.log('Vous êtes né en ' + anneedenaissance) }; | |
process.exit() | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment