Skip to content

Instantly share code, notes, and snippets.

@Fuzzyma
Created June 14, 2025 10:09
Show Gist options
  • Save Fuzzyma/bf3a80c76cf9bef40aafa0fe107bafaf to your computer and use it in GitHub Desktop.
Save Fuzzyma/bf3a80c76cf9bef40aafa0fe107bafaf to your computer and use it in GitHub Desktop.
const all = [...document.querySelectorAll("#canvas div")];
const map = {};
// I could use 4 filters but I rather loop once
all.forEach((a) => {
const isBrain = a.textContent === "🧠";
const isStraight = Number(a.classList[2].split("-")[1]) % 90 === 0
const isLeft = Number(a.classList[0].split("-")[1]) < 50;
const key = `${isBrain}${isStraight}${isLeft}`;
map[key] = (map[key] ?? 0) + 1;
});
console.log({
straightBrains: map["truetruetrue"] + map["truetruefalse"],
leftBrains: map["truetruetrue"] + map["truefalsetrue"],
straightHearts: map["falsetruetrue"] + map["falsetruefalse"],
rightHearts: map["falsetruefalse"] + map["falsefalsefalse"],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment