this.DEVMODE |
Instance Property, Default Value |
this.DEBUG |
- |
✅ |
✅ |
Public |
✅ |
Gets/Sets the class debug state, affects the default value for per function optional param: debug |
this.LOGLEVEL |
Instance Property, Default Value |
this.LEVEL |
- |
✅ |
✅ |
Public |
✅ |
Gets/Sets the class VERBOSITY level for console, affects the default value for per function optional param: level |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
GameLogic.P1 |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Public |
🛑 |
Gets the immutable Player 1 token: X |
GameLogic.P2 |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Public |
🛑 |
Gets the immutable Player 2 token: O |
GameLogic.P1_TOKENS |
Encapsulated Class Constant |
this._xChars |
{array} |
✅ |
❌ |
Private |
🛑 |
Gets array of Player 1 token characters: X or x : A design choice for variability in token font/display based on font choice |
GameLogic.P2_TOKENS |
Encapsulated Class Constant |
this._oChars |
{array} |
✅ |
❌ |
Private |
🛑 |
Gets array of Player 2 token: O or o |
GameLogic.REG_SEARCH_LENGTH |
Encapsulated Class Constant, Default Value |
-- |
{number} |
✅ |
❌ |
Private |
🛑 |
Gets regex length of win sequence to search : 3 |
GameLogic.REG_SEARCH_ALL |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Private |
🛑 |
Gets global regex flag to search for all instances, not just first found: g |
GameLogic.REG_SEARCH_FILTER |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Private |
🛑 |
Gets string to replace & filter out of the regex search on test: `` |
GameLogic.WIN_COMBINATIONS |
Encapsulated Class Constant, Default Value |
-- |
{array(8)<strings(length:3)>} |
✅ |
❌ |
Private |
✅ |
Gets the possible (8) winning combinations/permutations as array of (8) strings |
GameLogic.AS_DRAW |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Public |
✅ |
Gets game's (end) state for a draw (has a result/end state), which is a truthy logic: true |
GameLogic.IN_PLAY |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Public |
✅ |
Gets game's state for in play (no result/end state), which is a falsey logic: false |
GameLoic.CELL_RESET |
Encapsulated Class Constant, Default Value |
-- |
{null} |
✅ |
❌ |
Private |
✅ |
Gets default cell value for grid array initialisation/reset: null |
GameLogic.MAX_LENGTH |
Encapsulated Class Constant, Default Value |
-- |
{null} |
✅ |
❌ |
Private |
✅ |
Gets the default grid array's length/size: 9 |
GameLogic.TURN_RESET |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Private |
✅ |
Gets default turn value for initialisation/reset: ' ' |
GameLogic.TURN_INIT |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Private |
✅ |
Gets default turn init value for the number of turns per game, as this increments: ' ' |
GameLogic.X_TURNS_PROP |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Private |
✅ |
Gets default turn property for X 's turn tracking: '._xTurns' |
GameLogic.O_TURNS_PROP |
Encapsulated Class Constant, Default Value |
-- |
{string} |
✅ |
❌ |
Private |
✅ |
Gets default turn property for O's turn tracking : '._oTurns' |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
this.WIN_SEQUENCE |
Instance Property, As-Is Value |
this._winSeq |
{string} |
✅ |
❌ |
Private |
✅ |
Gets the current, static, Win Sequence array 's value |
this.GRID |
Instance Property, As-Is Value |
this._grid |
{Array} |
✅ |
✅ |
Public |
✅ |
Gets/sets the current grid's array |
this.NEW_GRID |
Instance Property, As-Is Value |
this._grid |
new {Array} |
✅ |
✅ |
Private |
✅ |
Gets/sets (initialises) the new grid's array of 9 length and null values: see MAX_LENGTH , CELL_RESET |
this.IFWON |
Instance Property, As-Is Value |
this._won |
{boolean|string} |
✅ |
✅ |
Public |
✅ |
Gets/sets the game's current/end win state, and winner. Initialsed as: false , per turn is false for next round, or ends as: X v O |
this.IFDRAWN |
Instance Property, As-Is Value |
this._draw |
{boolean} |
✅ |
✅ |
Public |
✅ |
Gets/sets the game's current/end drawn state. Initialised as: false , end state: true |
this.TURNS |
Instance Property, As-Is Value |
this._turns |
{string} |
✅ |
❌ |
Public |
✅ |
Gets the current, static, Win Sequence array's value |
this.MAX_TURNS |
Instance Property, As-Is Value |
--- |
{number} |
✅ |
❌ |
Private |
✅ |
Computes the max number of turns from grid length: MAX_LENGTH - 1 |
this.CELL |
Instance Property, As-Is Value |
--- |
{string|null} |
✅ |
❌ |
Private |
✅ |
Gets/sets the current cell reference to grid value: X or O |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
this.currentCell(index) |
Accessor/helper API function, Computed Value |
--- |
{string} |
✅ |
✅ |
Public |
✅ |
Sets/returns the class member for current cell by retrieves the current cell value from the grid at index: * |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |
:--- |