Created
April 11, 2017 19:34
-
-
Save qingwei91/ab339e763006c169d8386fd653936f83 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
class Server { | |
def main(): Unit = { | |
while (true) { | |
/** | |
* 1. Read user inputs which can be one of [←, ↑, →, ↓], to change the direction of snake. | |
* 2. Apply user input if any, which change the direction of snake. | |
* 3. Move snake by 1 unit space | |
* 4. Check if any snakes bump into enemy/wall/self, remove them from the game. | |
* 5. Broadcast the new game state to all clients | |
*/ | |
Thread.sleep(100) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment