<commit_before># Ultimate TTT - Server
> Ultimate Tic Tac Toe Algorithm - Game Server

[![Travis](https://img.shields.io/travis/aurbano/ultimate-ttt-server.svg)](https://travis-ci.org/aurbano/ultimate-ttt-server)
[![Coverage Status](https://coveralls.io/repos/github/aurbano/ultimate-ttt-server/badge.svg?branch=master)](https://coveralls.io/github/aurbano/ultimate-ttt-server?branch=master)

This is a system intended for games & hackathons mainly, for teams to write their own bot and compete against other bots.

They will be playing games of ["Ultimate Tic Tac Toe"](https://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe/), which provides a great opportunity for learning, predicting moves...

### Online mode

By default, the server will start in online mode and listen for players on port `3141`:

```bash
$ uttt
```

```
+-----------------------------------+
|   Ultimate TTT Algorithm Battle   |
+-----------------------------------+

Server started on: http://localhost:3141
```

### Local mode

The game server can run games locally, if the players have been written in JavaScript and are reachable from the server.

```bash
$ uttt --local -a path/to/programOne -b path/to/programTwo
```

To run a quick test you can use the sample implementation provided:

```bash
$ uttt --local -a sample/random -b sample/random
```

Sample output:

```
+----------------------------------+
|   Ultimate TTT Algorithm Fight   |
+----------------------------------+<commit_msg>add options to readme<commit_after># Ultimate TTT - Server
> Ultimate Tic Tac Toe Algorithm - Game Server

[![Travis](https://img.shields.io/travis/aurbano/ultimate-ttt-server.svg)](https://travis-ci.org/aurbano/ultimate-ttt-server)
[![Coverage Status](https://coveralls.io/repos/github/aurbano/ultimate-ttt-server/badge.svg?branch=master)](https://coveralls.io/github/aurbano/ultimate-ttt-server?branch=master)

This is a system intended for games & hackathons mainly, for teams to write their own bot and compete against other bots.

They will be playing games of ["Ultimate Tic Tac Toe"](https://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe/), which provides a great opportunity for learning, predicting moves...

### Online mode

By default, the server will start in online mode and listen for players on port `3141`:

```bash
$ uttt
```

```
+-----------------------------------+
|   Ultimate TTT Algorithm Battle   |
+-----------------------------------+

Server started on: http://localhost:3141
```

Options:

```
uttt

  Ultimate Tic Tac Toe - Game Server

Options

  --verbose           The input to process.
  -v, --version       Display the server version
  -p, --port 3141     Port on which the server should be started (defaults to 3141)
  -l, --local         Play games locally executing the players code directly (not recommended)
  -a, --a file        Client 1 for the algorithm competition (for local games only)
  -b, --b file        Client 2 for the algorithm competition (for local games only)
  -g, --games 1000    Number of games to play, defaults to 1000
  -t, --timeout 100   Milliseconds after which a player loses (defaults to 100)
  -h, --help          Print this guide

Synopsis

  $ uttt
  $ uttt --games 100
  $ uttt --port 5000
  $ uttt --local -a path/to/programOne -b path/to/programTwo
  $ uttt --help
```

### Local mode

The game server can run games locally, if the players have been written in JavaScript and are reachable from the server.

```bash
$ uttt --local -a path/to/programOne -b path/to/programTwo
```

To run a quick test you can use the sample implementation provided:

```bash
$ uttt --local -a sample/random -b sample/random
```

Sample output:

```
+----------------------------------+
|   Ultimate TTT Algorithm Fight   |
+----------------------------------+
{'fraction_non_alphanumeric': 0.1815554387808723, 'fraction_numerical': 0.01655281135049921, 'mean_word_length': 2.643062200956938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1478221', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1096, 'n_words': 393}