Untitled
unknown
plain_text
3 years ago
492 B
9
Indexable
const gameBoardController = (() => {
const gameBoardArray = ['', '', '', '', '', '', '', '', ''];
const generateNewBoard = () => {
for (i of boardSquares) {
i.innerText = '';
i.style.cursor = `pointer`;
i.addEventListener('click', handlePlayerMove);
}
};
const placeMarker = (index, marker) => {
gameBoardArray[index] = marker;
};
const getPositions => gameBoardArray;
return {
generateNewBoard,
placeMarker,
getPositions
};
})();
Editor is loading...