Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
commit
07cdbba936
6336
assets/blacks.txt
6336
assets/blacks.txt
File diff suppressed because it is too large
Load Diff
22583
assets/whites.txt
22583
assets/whites.txt
File diff suppressed because it is too large
Load Diff
|
|
@ -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[]) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user