Your bot will be written in python and will create a class that inherits from BotSkeleton
. An example test bot is shown below.
from bot_skeleton import BotSkeleton
from typing_hints import PositionDict, Position
from board import Board
from typing import List
import random
class BotNameTest(BotSkeleton):
def __init__make_move(self, no_botsboard: Board, bot_idpositions: PositionDict) -> Position:
self.no_botsboard = no_botsboard
self.bot_idposition = bot_idpositions[self.bot_id]
valid_moves = self.get_valid_moves()
try:
return random.choice(valid_moves)
except IndexError:
return None
def make_moveget_valid_moves(self,) board,-> positions)List[Position]:
my_positionmoves = positions[selffilter(self.bot_id]board.position_valid, ((self.position[0]+1, self.position[1]),
new_position = my_position[0] + (self.position[0]-1, my_position[1]self.position[1]),
(self.position[0], self.position[1]+1),
(self.position[0], self.position[1]-1)))
return new_positionlist(moves)
(Type hints are not required but illustrated here to help understanding)
Methods in Board
:
get_random_empty_pos() -> Position
- Returns a position at random that is empty
position_valid(pos: Position) -> bool
- returns if a position is inside the board and is currently empty
copy() -> Board
- return a copy of the board that is writable
##Tournament structure
- Every bot will get pitted against every other bot in a giant arena
- That is to say every single bot will be in every battle
- The size of the arena will be
(N*1030, N*1030)
in size where N
is the total. This may be increased depending on number of bots entered.