https://github.com/jdan/nim
The game of nim running over telnet
https://github.com/jdan/nim
Last synced: 3 months ago
JSON representation
The game of nim running over telnet
- Host: GitHub
- URL: https://github.com/jdan/nim
- Owner: jdan
- Created: 2014-03-02T02:20:23.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-02T02:29:11.000Z (over 12 years ago)
- Last Synced: 2025-01-01T02:41:32.861Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## nim
The game of nim, written in node
### Server
To run the server:
```
$ node index.js
Starting game server...
```
By default the game runs on port 8080.
### Client
You play this game through `telnet`.
```
$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Waiting for one more...
```
Once another client connects...
```
Welcome!
The current state is:
1 4 2
It's your turn!
>
```
### Making Moves
A move in nim consists of taking one or more coins from a given pile. If
there are no available moves, the current player loses.
To player, enter two numbers:
* The pile which you want to pick from (starting at 1)
* The amount of coins you want to take
For example:
```
The current state is:
1 4 2
It's your turn!
> 2 4
The current state is:
1 0 2
```
### TODO
* Handle disconnects gracefully
### License
MIT © [Jordan Scales](http://jordanscales.com)