14 lines
357 B
JavaScript
14 lines
357 B
JavaScript
export class TTTBoard {
|
|
constructor() {
|
|
this.stateArray = [
|
|
[null, null, null],
|
|
[null, null, null],
|
|
[null, null, null]
|
|
];
|
|
}
|
|
|
|
// This is a fun exploit of JavaScript's loose Typing, player can be a nested TTTBoard!
|
|
play(row, col, player) {
|
|
this.stateArray[row][col] = player;
|
|
}
|
|
} |