/c4

Elixir implementation of Connect 4 with a TCP client

Primary LanguageElixir

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

iex -S mix

# or 

make dev

The server will launch locally with hostname localhost and port 6677.

Docker deployment

Build the continer

make docker-build

Start the container

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.

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.