Skip to content

Instantly share code, notes, and snippets.

@slior

slior/drawing.js Secret

Created November 1, 2020 21:21
Show Gist options
  • Save slior/ab8b00b00d6c59c93ebe4dfd7565c906 to your computer and use it in GitHub Desktop.
Save slior/ab8b00b00d6c59c93ebe4dfd7565c906 to your computer and use it in GitHub Desktop.
Mancala (384fd01d7acda41e1611dc2f7f34104660bdfc81) - ui elements def
let stoneUIElement = [];
...
function initDrawingElements(cellCount)
{
range(1,cellCount).forEach( _ => stoneUIElement.push(None));
}
function rememberUIObj(boardCell,el) { stoneUIElement[boardCell] = maybe(el); }
function forgetUIObj(boardCell) { stoneUIElement[boardCell] = None; }
function uiObjAt(boardCell) { return stoneUIElement[boardCell]; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment