https://github.com/nicklayb/c4
Elixir implementation of Connect 4 with a TCP client
https://github.com/nicklayb/c4
Last synced: about 1 year ago
JSON representation
Elixir implementation of Connect 4 with a TCP client
- Host: GitHub
- URL: https://github.com/nicklayb/c4
- Owner: nicklayb
- Created: 2023-08-06T17:08:30.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-08T04:28:09.000Z (almost 3 years ago)
- Last Synced: 2024-04-15T03:51:36.399Z (about 2 years ago)
- Language: Elixir
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C4
Connect 4 game with TCP front end
## Installation
### Local deployment
#### Requirements
- `direnv` for local environment configuration
#### Create env file
Create a `../.c4.envrc` file and add at least the following
```
export C4_TCP_SERVER_PORT=6677
```
#### Start server
```bash
iex -S mix
# or
make dev
```
The server will launch locally with hostname `localhost` and port `6677`.
### Docker deployment
Build the continer
```bash
make docker-build
```
Start the container
```bash
docker run -p 6677:6677 -e C4_TCP_SERVER_PORT=6677 c4:latest
```
## Connect
Using either `nc` or `telnet`, simply connect to ther server's endpoint.
```bash
telnet localhost 6677
```
You should see a "Welcome" message with some indication.
## General usage
When connecting to the server, the first thing you need to do is enter a username. The username will then be shown in the prompt confirming. You can then run `help` to see what you can do.