spanish
This commit is contained in:
parent
84c359ae99
commit
441b1a8f49
6336
assets/blacks.txt
6336
assets/blacks.txt
File diff suppressed because it is too large
Load Diff
22532
assets/whites.txt
22532
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")
|
||||
}
|
||||
|
||||
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 function randomCard(cards: string[]) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user