This commit is contained in:
Neo 2025-05-18 18:24:37 -04:00
parent 84c359ae99
commit 441b1a8f49
4 changed files with 126 additions and 28748 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,11 @@ async function parseCards(file: string) {
return fileData.split("\n") return fileData.split("\n")
} }
export const blacks = (await parseCards("assets/blacks.txt")).filter(card => card.split("{{fill}}").length < 2) function countOccurrences(data: string, val: string) {
return [...val.matchAll(new RegExp(`${data}`, "gm"))].length
}
export const blacks = (await parseCards("assets/blacks.txt")).filter(card => countOccurrences("{{fill}}", card) <= 1)
export const whites = await parseCards("assets/whites.txt") export const whites = await parseCards("assets/whites.txt")
export function randomCard(cards: string[]) { export function randomCard(cards: string[]) {