C# Class EricVoglBattleship.BattleshipStatisticalUtility

Utility methods
显示文件 Open project: solium/hacklympics

Public Methods

Method Description
PositionPossibilities ( int index, int length, List ships ) : int

Determines the number of possible ship orientations of a given size in a given 1D space at a given position in that space

PositionPossibilities ( int index, int length, int size ) : int

Determines the number of possible ship orientations of a given size in a given 1D space at a given position in that space

ShipPossibilityMatrix ( int width, int height, List ships ) : ].Score2D[

Populates a matrix with number of ship position possibilities in each row/column (divided by ship type and orientation)

ShipPossibilityMatrix ( int width, int height, List ships, int &totalPositions ) : ].int[

Populates a matrix with number of ship position possibilities in each row/column

Method Details

PositionPossibilities() public static method

Determines the number of possible ship orientations of a given size in a given 1D space at a given position in that space
public static PositionPossibilities ( int index, int length, List ships ) : int
index int position in 1D space
length int size of 1D space
ships List ships in 1D space
return int

PositionPossibilities() public static method

Determines the number of possible ship orientations of a given size in a given 1D space at a given position in that space
public static PositionPossibilities ( int index, int length, int size ) : int
index int position in 1D space
length int size of 1D space
size int
return int

ShipPossibilityMatrix() public static method

Populates a matrix with number of ship position possibilities in each row/column (divided by ship type and orientation)
public static ShipPossibilityMatrix ( int width, int height, List ships ) : ].Score2D[
width int Width of board
height int Height of board
ships List Ships in play
return ].Score2D[

ShipPossibilityMatrix() public static method

Populates a matrix with number of ship position possibilities in each row/column
public static ShipPossibilityMatrix ( int width, int height, List ships, int &totalPositions ) : ].int[
width int Width of board
height int Height of board
ships List Ships in play
totalPositions int Total position possibilities
return ].int[