Reproduce the classic Snake game in your terminal with NodeJs.
Steps:
process.stdin
to find out how to get the user's input.(Yes the vertical movement is kinda weird, it's because of the terminal line height)
Around 1h30
Around 250
process.stdin
has everything you need to read the user's input, and prevent the script to exit immediately:
// prevent the script to exit itself process.stdin.resume() // don't write the input to the console process.stdin.setRawMode(true) // if you don't set the encoding, you'll get binary crap. process.stdin.setEncoding('utf8')