From bc6ec5197e074016c72627856bf1741f98a64cd4 Mon Sep 17 00:00:00 2001 From: datalore Date: Fri, 3 Nov 2023 20:27:44 +0100 Subject: [PATCH] Use only size*size items for bingo --- src/app/components/bingo.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/components/bingo.tsx b/src/app/components/bingo.tsx index 255670c..bdd7a27 100644 --- a/src/app/components/bingo.tsx +++ b/src/app/components/bingo.tsx @@ -6,10 +6,11 @@ interface Props{ } export default function Bingo({size, items}: Props){ + const activeItems: string[] = items.slice(0, size*size); let rows: string[][] = []; - for(let i = 0; i < (items.length / size); i++) + for(let i = 0; i < (activeItems.length / size); i++) { - rows[i] = items.slice(i * size, (i + 1) * size); + rows[i] = activeItems.slice(i * size, (i + 1) * size); } return(