Skip to content

Instantly share code, notes, and snippets.

@joshgachnang
Created July 12, 2015 07:03
Show Gist options
  • Save joshgachnang/efa0443c5d11eca0bc65 to your computer and use it in GitHub Desktop.
Save joshgachnang/efa0443c5d11eca0bc65 to your computer and use it in GitHub Desktop.
process.stdin.setEncoding('utf8');
process.stdin.on('readable', function () {
var chunk = process.stdin.read();
if (chunk === null) {
return;
}
var line = chunk.split(" ");
if (line.length == 3 && line[0] == "Action") {
// A move is requested
console.log("check 0\n");
}
else {
// Game settings, round information and opponent moves are also
// given
return;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment