Skip to main content
added 11 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
added 1054 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
added 1054 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23

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.

Your bot will be written in python and will create a class that inherits from BotSkeleton.

from bot_skeleton import BotSkeleton


class BotName(BotSkeleton):
 
    def __init__(self, no_bots, bot_id):
        self.no_bots = no_bots
        self.bot_id = bot_id

    def make_move(self, board, positions):
        my_position = positions[self.bot_id]
        new_position = my_position[0] + 1, my_position[1]
        return new_position

##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*10, N*10) in size where N is the total number of bots.

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 Test(BotSkeleton):
    def make_move(self, board: Board, positions: PositionDict) -> Position:
        self.board = board
        self.position = positions[self.bot_id]
        valid_moves = self.get_valid_moves()
        try:
            return random.choice(valid_moves)
        except IndexError:
            return None

    def get_valid_moves(self) -> List[Position]:
        moves = filter(self.board.position_valid, ((self.position[0]+1, self.position[1]),
                                                   (self.position[0]-1, self.position[1]),
                                                   (self.position[0], self.position[1]+1),
                                                   (self.position[0], self.position[1]-1)))
        return list(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 (30, 30). This may be increased depending on number of bots entered.
no maximum number of bots
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
Loading
added 113 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
Loading
added 103 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
Loading
deleted 1205 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
Loading
added 26 characters in body
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
Loading
Source Link
Blue
  • 28.6k
  • 1
  • 17
  • 23
Loading