pytron-book/src/pytron-web.md

46 lines
1.8 KiB
Markdown

# About Pytron-web
[Pytron-web](http://pytron.tforgione.fr) is a website where you can upload your
AI and see it compete with other AIs from other people.
On the index of the site, you can see the leaderboard, as well as the results
of all battles.
Note that this website is hosted on an N7 server, so you won't be able to
access it if you're not on the N7 local network (you can still use it through
the VPN).
### Battle system
All the possible battles are done: each AI will have to battle each other AI.
For each pair of AIs, 100 battles will be launched, on a predetermined,
symmetric set of initial positions.
The size of the map for this is 10x10, so you need to make sure that your AI
will work with those sizes.
### How to upload your AI
There are two ways to upload your AI:
##### [On the website](https://pytron.tforgione.fr/upload/)
You will have to enter the name of your AI and upload a ZIP archive of your AI.
This archive must contain a file named `ai.py` which must contain a class `Ai`
which must have a constructor that takes no arguments. It may also contain some
other files, that will be placed next to the `ai.py` file on the server.
##### With the upload script
In the `pytron` repository, there is a script named `upload` which will allow
you to upload your AI.
It assumes that your AIs are stored in the `ais` directory, at the root of the
repository. Each AI must be in its own directory, and must contain a file named
`ai.py` which must contain a class `Ai` which must have a constructor that
takes no arguments.
This script is interactive, you can launch it by typing
``` bash
./upload
```
and it will look for AIs. If it doesn't find any AI, it will print an error
message, and if it finds many, it will ask you which one you want to upload.
It will then process to create the archive and upload it to the server itself.