Created
January 8, 2012 08:38
-
-
Save nornagon/1577731 to your computer and use it in GitHub Desktop.
Sequencing stuff in node.js
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
| function getMoveFromPlayer(player_id, cb) { | |
| process.spawn_child(whatever, cb) | |
| } | |
| function getNextMove() { | |
| if (!gameStillRunning) { return } | |
| getMoveFromPlayer(current_player, function (err, data) { | |
| makeMove(data) | |
| getNextMove() | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment