| Package | com.lookbackon.ds |
| Class | public class NumberBoard |
| Inheritance | NumberBoard Object |
See also
| Property | Defined By | ||
|---|---|---|---|
| backwardDiagonalLabels : Array [read-only]
| NumberBoard | ||
| forwardDiagonalLabels : Array [read-only]
| NumberBoard | ||
| horizontalLabels : Array [read-only]
| NumberBoard | ||
| magicWinNumber : uint [read-only]
| NumberBoard | ||
| numOfWinPlaces : int [read-only]
This function returns the number of possible win positions on a board
of dimensions x by y with n being the number of pieces required in a
row in order to win. | NumberBoard | ||
| verticalLabels : Array [read-only]
| NumberBoard | ||
| z : int [read-only]
Each n-in-a-row area on the board in which a winning connection
can be made is given a unique number from 0 to z-1. | NumberBoard | ||
| Method | Defined By | ||
|---|---|---|---|
NumberBoard(x:int, y:int, n:int, h:Boolean, v:Boolean, f:Boolean, b:Boolean)
A magic number board data structure, mixed number labels' permutation and combination. | NumberBoard | ||
Should keep the providing board as the same size of numberboard. | NumberBoard | ||
hasConnex(x:int, y:int, ref:Array, dir:String):Boolean
The referenced source's connex determined by number board's label with direction and the length of connection;
| NumberBoard | ||
toString():String | NumberBoard | ||
| Method | Defined By | ||
|---|---|---|---|
backwardDiagonalFillIn():void | NumberBoard | ||
forwardDiagonalFillIn():void | NumberBoard | ||
horizontalFillIn():void | NumberBoard | ||
setupMap():void
an array in which each element is a list specifying,
for each corresponding board space,
which n-in-a-row areas it is part of. | NumberBoard | ||
verticalFillIn():void | NumberBoard | ||
| Constant | Defined By | ||
|---|---|---|---|
| BACKWARD_DIAGONAL : String = B [static] | NumberBoard | ||
| FORWARD_DIAGONAL : String = F [static] | NumberBoard | ||
| HORIZONTAL : String = H [static] | NumberBoard | ||
| VERTICAL : String = V [static] | NumberBoard | ||
| backwardDiagonalLabels | property |
backwardDiagonalLabels:Array [read-only]
public function get backwardDiagonalLabels():Array| forwardDiagonalLabels | property |
forwardDiagonalLabels:Array [read-only]
public function get forwardDiagonalLabels():Array| horizontalLabels | property |
horizontalLabels:Array [read-only]
public function get horizontalLabels():Array| magicWinNumber | property |
magicWinNumber:uint [read-only]
public function get magicWinNumber():uint| numOfWinPlaces | property |
numOfWinPlaces:int [read-only] This function returns the number of possible win positions on a board of dimensions x by y with n being the number of pieces required in a row in order to win.
public function get numOfWinPlaces():int| verticalLabels | property |
verticalLabels:Array [read-only]
public function get verticalLabels():Array| z | property |
z:int [read-only] Each n-in-a-row area on the board in which a winning connection can be made is given a unique number from 0 to z-1. Each space on the board is told which n-in-a-row areas it is part of. This is done with the array...
public function get z():int| NumberBoard | () | Constructor |
public function NumberBoard(x:int, y:int, n:int, h:Boolean, v:Boolean, f:Boolean, b:Boolean)A magic number board data structure, mixed number labels' permutation and combination.
Parametersx:int — the width of map.
| |
y:int — the height of map.
| |
n:int — the connection number in some direction.
| |
h:Boolean — whether horizontal connection.
| |
v:Boolean — whether vertical connection.
| |
f:Boolean — whether forward diagonal connection.
| |
b:Boolean — whether backward diagonal connection.
|
| backwardDiagonalFillIn | () | method |
protected function backwardDiagonalFillIn():void| forwardDiagonalFillIn | () | method |
protected function forwardDiagonalFillIn():void| getConnex | () | method |
public function getConnex(board:Array2, len:int, pattern:Function):ArrayShould keep the providing board as the same size of numberboard. Partial with flag object to indentify the connex elements. Return the connex results,such as z[0]-horizontally,z[1]-vertically,z[2]-forwardDiagonal,z[3]-backwardDiagonal
Parameters
board:Array2 — the board resource;
| |
len:int — the length of connex;
| |
pattern:Function — the connex's match pattern function with parameter such as('RRR','BBB','RBR','RRB'...);
|
Array — the calculated connections categoried by array;
|
| hasConnex | () | method |
public function hasConnex(x:int, y:int, ref:Array, dir:String):BooleanThe referenced source's connex determined by number board's label with direction and the length of connection;
Parameters
x:int — the x coordinate.
| |
y:int — the y coordinate.
| |
ref:Array — the referenced source.
| |
dir:String — the direction label.
|
Boolean — whether the connex label on the direction existed.
|
| horizontalFillIn | () | method |
protected function horizontalFillIn():void| setupMap | () | method |
protected function setupMap():voidan array in which each element is a list specifying, for each corresponding board space, which n-in-a-row areas it is part of.
| toString | () | method |
public function toString():StringReturnsString |
| verticalFillIn | () | method |
protected function verticalFillIn():void| BACKWARD_DIAGONAL | Constant |
public static const BACKWARD_DIAGONAL:String = B| FORWARD_DIAGONAL | Constant |
public static const FORWARD_DIAGONAL:String = F| HORIZONTAL | Constant |
public static const HORIZONTAL:String = H| VERTICAL | Constant |
public static const VERTICAL:String = V