Skip to content

Instantly share code, notes, and snippets.

@quinnlas
quinnlas / mystery.js
Last active April 24, 2023 23:41
What does this function do?
const fn = (n, a = [[], '']) => n in a ? !!a[n] : (a.push(...a), fn(n, a))
// an array with 0 for empty, 1 for black, and 2 for white
let board = Game.currentState.cellStatus
let remainingEmpty = 0
// number should be 1 for black, 2 for white
async function makeMove(row, col, number) {
for (let i = 0; i < number; i++) {
Game.startMove({ row, col })
Game.endMove()
@quinnlas
quinnlas / gist:8074e88a73967ea8e16f5b2f11879031
Last active April 3, 2023 03:48
birthday problem calculator
let birthday = n => {let r=1;for(let i=1;i<n;i++){r*=(366-i)/366}return 1-r}