Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
C++ Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
Corners in different programming languages. http://ru.wikipedia.org/wiki/%D0%A3%D0%B3%D0%BE%D0%BB%D0%BA%D0%B8 http://en.wikipedia.org/wiki/Ugolki Game engine. Game engine is run by ./run.sh script. Usage: `./run.sh MAP PLAYER1 PLAYER2` where: - MAP is path to map file. Use maps/default.yaml if not sure. - PLAYER1/2 is command line to run bot or - to play for that player manually. To play with your friend: ./run.sh maps/8x8x15.yaml - - To play against demo 1-turn bot: ./run.sh maps/8x8x10.yaml - "python demo-bot-1-turn.py" To make two bots play against each other: ./run.sh maps/8x8x10.yaml "python demo-bot-1-turn.py" "python demo-bot-1-turn.py" Bot protocol. Bot is just a program that reads board state on stdin and outputs moves on stdout. Protocol is stateless in a sense that your bot will always get complete board state and always ought to respond with a complete move. There is no "!you-play-for 1" or partial moves or whatever. Board state (bot input) looks like: !board 1 8 1111.... 111..... 11...... 1....... .......2 ......22 .....222 ....2222 What it means: - "!" means a command to bot. There is only one command 'board' right now. - "1" is player chip (mark). First player has chip "1", second has chip "2". Empty cells have chip "." (period). - "8" is number of lines in board. After first line, your bot must read this number of lines. Bot should parse next 8 lines and produce a move which satisfies game rules (see wikipedia links on top). Here how a valid respond looks like: @turn 4:1-5:1 What it means: - "@" is a response from bot. There is only one response 'turn' right now. If you want to express "i give up" - just close stdout. - "4:1" is a starting point. 4 is X coordinate, 1 is Y. Coordinates are 1-based, so top-left corner is 1:1. - "-" is step delimiter. Your move may contain as many valid steps as possible. This is valid turn for board above: 3:1-3:3-2:4-1:5. You can supply as many spaces around all tokens as you want. This is valid response: @turn 4 : 5 - 5: 1 *Warning* bot MUST always produce a valid turn (according to game rules). The game stops after first invalid turn.