Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend to Adjust Max List Length #3

Open
TrevorLowing opened this issue Feb 16, 2022 · 0 comments
Open

Recommend to Adjust Max List Length #3

TrevorLowing opened this issue Feb 16, 2022 · 0 comments

Comments

@TrevorLowing
Copy link

TrevorLowing commented Feb 16, 2022

I was working to add the option to load questions from predefined lists and I noticed your routine doesn't limit the number of entries. Typically Bingo games are either 75 balls or 90 balls (https://en.wikipedia.org/wiki/Bingo_(American_version)). So I recommend shuffling the entries array and slicing it at 75 so the expected "win rate per card" matches expectations.

      if (entriesArray.length < 24) {
        document.getElementById("entryTextArea").setCustomValidity("A game requires at least 24 entries, one per line!");
        isValid = false;
      }else if (entriesArray.length > 75){
        // Typical games are 75 or 90 ball Bingo balls, so limit range to those. Scramble array then truncate
        shuffleArray(entriesArray);
        entriesArray = entriesArray.slice(0, 74);
      } else {
        document.getElementById("entryTextArea").setCustomValidity("");
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant