Skip to content

Commit

Permalink
Add instructions to run locally and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
McLargo committed Nov 15, 2024
1 parent f483f80 commit d91b595
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SHELL := /bin/bash
SERVER_PORT := 50051
BOT_PORT := 3001
BOT_NAME := go-bot1

runbotgo:
go run ./src/bot.go -bn=$(BOT_NAME) -la=:$(BOT_PORT) -gs=:$(SERVER_PORT)

.PHONY: runbotgo
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,32 @@
This is a Go bot that can be used to play the game of Lighthouses on the CodeConz platform.

## Interaction flow with the Game Engine

![Interaction Flow](./docs/interaction_flow.png)

The bot interacts with the game engine in three steps:
1. **Join Game**: The bot sends a join request to the game engine to join the game. The game engine responds with the Bot ID.
2. **Get Initial State**: The game engine sends get the initial state of the game to the bots.

1. **Join Game**: The bot sends a join request to the game engine to join the
game. The game engine responds with the Bot ID.
2. **Get Initial State**: The game engine sends get the initial state of the
game to the bots.
3. **Turn request**: The game engine requests the bot to make an action on each turn, and sends the current state to the bot. The bot responds with the action.

For more in depth information on the game, please refer to the [Game Engine documentation](https://github.com/intelygenz/codeconz-lighthouses-engine/blob/master/README.md).
For more in depth information on the game, please refer to the [Game Engine documentation](https://github.com/intelygenz/codeconz-lighthouses-engine/blob/master/README.md).

## Run locally

To run the bot locally, you need to have Go installed on your machine. You can
download Go from [here](https://golang.org/dl/).

To run the bot, you can use the following command:

```bash
make runbotgo
```

## Notes

- You can start implementing your bot in the `src/bot.go` file.
- Do not change anything in the Dockerfile, .github/workflows or protobuf files.
- The bot will not be able to connect to the game engine if it is not running.

0 comments on commit d91b595

Please sign in to comment.