Created
August 1, 2015 20:06
-
-
Save sujith3g/70a49e4ae2ca18e4153f to your computer and use it in GitHub Desktop.
This file contains hidden or 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'); | |
process.stdin.on('data', start); | |
function start(chunk){ | |
var chunks = chunk.toString().split('\n'); | |
// maxcount = chunks.shift(); | |
chunks = chunks.filter(function(e){return e}); | |
for (var i=0; i < chunks.length; i++ ){ | |
if(chunks[i] === "42") break; | |
console.log(chunks[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment