[CLEANUP] Some fixes so that Day4 could be deployed to firebase

This commit is contained in:
2021-12-05 12:30:41 +01:00
parent f1192091eb
commit bc59bf0ed6
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ class Day4 implements Day {
const { drawnNumbers, bingoCards } = this.parseInput(input);
// We are done as soon as we encounter the first bingo
return this.playBingo(drawnNumbers, bingoCards, b => ({ isDone: true }) ).score;
return this.playBingo(drawnNumbers, bingoCards, _ => ({ isDone: true }) ).score;
}
part2(input: string[]): number | string {
@@ -24,7 +24,7 @@ class Day4 implements Day {
playBingo(drawnNumbers: number[], bingoCards: BingoCard[], bingoHandler: (b: Bingo, bingoCard: BingoCard, allCards: BingoCard[]) => { isDone: boolean }): Bingo {
for (const draw of drawnNumbers) {
for (let bingoCard of bingoCards) {
for (const bingoCard of bingoCards) {
const cardResult = bingoCard.cross(draw);
if (cardResult instanceof Bingo) {
const handleResult = bingoHandler(cardResult, bingoCard, bingoCards);