updated to 18 artists per game

This commit is contained in:
marsteralex 2022-09-13 14:04:36 +02:00
parent 37da650aca
commit 68bdadde37

View File

@ -50,6 +50,7 @@ function putIntoMapAndFetch(data) {
} }
cardNames = Array.from(Object.keys(allData)) cardNames = Array.from(Object.keys(allData))
window.console.log(allData) window.console.log(allData)
window.console.log(cardNames)
window.console.log(total) window.console.log(total)
if (whichGuesser === 'counterspell') { if (whichGuesser === 'counterspell') {
document.getElementById('guess-type').innerText = 'Counterspell Guesser' document.getElementById('guess-type').innerText = 'Counterspell Guesser'
@ -97,26 +98,23 @@ function getKSamples() {
delete allData[key] delete allData[key]
} }
} }
if (whichGuesser == 'artist') { let count = 0
usedCounters = new Set(cardNames) shuffleArray(cardNames)
} else { for (let j = 0; j < cardNames.length; j++) {
let count = 0 key = cardNames[j]
shuffleArray(cardNames) value = cardNames[key]
for (let j = 0; j < cardNames.length; j++) { if (usedCounters.has(key)) {
key = cardNames[j] continue
value = cardNames[key] } else {
if (usedCounters.has(key)) { window.console.log(key)
continue usedCounters.add(key)
} else { count++
window.console.log(key) if (count >= extra) {
usedCounters.add(key) break
count++
if (count >= extra) {
break
}
} }
} }
} }
return [samples, usedCounters] return [samples, usedCounters]
} }
@ -144,7 +142,7 @@ function createNewArtistMap() {
samples[key] = value samples[key] = value
newTotal += value.length newTotal += value.length
i++ i++
if (i >= k + extra) { if (i >= k + extra * 2) {
break break
} }
} }