Simple API specification
- Dominant language
- No language data
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
In order to unify the API between the different bots for the final competition between yovi implementations, the API required is the following:
Each yovi_xxx implementation has to support at least a `play` method with a GET method and the following query parameters:
- `position` (mandatory): a JSON record in YEN format that specifies the current position
- `bot_id` (optional): an identifier for one bot. This can be useful if some implementations have more than one bot.
The answer must can be:
- A movement specified by some coordinates like: `{"coords":{"x":1,"y":1,"z":0}}`
- A swap action in case that the implementations support the pie rule which must be something like: `{"action":"swap"}`
- Other possible actions like `resign` which can be expressed like `{"action":"swap"}`.
A possible way to test the implementations using `curl` is:
```sh
$ curl -G "http://localhost:3002/play" --data-urlencode 'position={"size":3,"turn":0,"players":["B","R"],"layout":"./B./..."}'
{"coords":{"x":1,"y":1,"z":0}}
```
The swap action could be:
```sh
$ curl -G "http://localhost:3002/play" --data-urlencode 'position={"size":3,"turn":0,"players":["B","R"],"layout":"./B./..."}'
{"action":"swap"}
```
The implementations can have other parameters if they want to add more customization to their bots, but for the competition, each team will use 2 bot_ids and the player will use the default parameters of those bots.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the yovi_xxx implementation's /play entry point and review how it currently accepts positions and identifies bots. Use the curl examples to exercise the endpoint, then verify that mandatory position input, optional bot_id handling, coordinate moves, and swap responses match the specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100