Types

These are the modules in the othello.game subpackage that deal with types.

othello.game.player

Player module.

class othello.game.player.Player

Player class representing a playable color.

property other

Returns the other player color.

Return type

Player

Returns

Player instance of opposite color.

othello.game.disc

Disc module.

class othello.game.disc.Disc

Disc object.

othello.game.disc.get_disc(player=None)

Returns Disc object based on given player.

Returns the Disc object corresponding to the player color if a Player type is passed, or a blank Disc if no argument is passed.

Parameters

player (Optional[Player]) – Disc will be made for this player (blank disc if None).

Return type

Disc

Returns

Corresponding Disc object.

othello.game.point

Point module.

class othello.game.point.Point

Point on board.

property col

Alias for field number 1

property row

Alias for field number 0

othello.game.move

Move module.

exception othello.game.move.InvalidMoveError

Raised upon invalid Move object initialization.

class othello.game.move.Move(point=None, is_pass=False, is_resign=False)

Represents a player’s move.

Should be instantiated with one of the defined alternative constructors.

point

Point to play if move is play, otherwise None.

is_play

A boolean indicating if the move is play disc.

is_pass

A boolean indicating if the move is pass.

is_resign

A boolean indicating if the move is resign.

classmethod pass_turn()

Constructor for pass type Move.

Return type

Move

Returns

A pass type Move instance.

classmethod play(point)

Constructor for play type Move.

Parameters

point (Point) – A Point representing where to play.

Return type

Move

Returns

A play type Move instance.

classmethod resign()

Constructor for resign type Move.

Return type

Move

Returns

A resign type Move instance.