Struct tak::board::Board [] [src]

pub struct Board {
    // some fields omitted
}

Methods

impl Board
[src]

fn new(board_size: usize) -> Board

fn at(&mut self, point: &Point) -> &mut Square

fn size(&self) -> usize

fn is_top(&self, player: Player, point: &Point) -> bool

fn check_winner(&self) -> Option<Player>

Checks for the winner

Uses follow to go from the right wall as far left as possible for each player, and then uses follow to go from the bottom wall as far up as possible. If the string of connected pieces reaches the far wall, it's a win.

Returns when the first winner is found. It will give a weird (wrong?) answer when a move causes both players to "win". Is there a rule about that?

Trait Implementations

impl Debug for Board
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Display for Board
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.