Use only size*size items for bingo
This commit is contained in:
parent
267582d8a1
commit
bc6ec5197e
@ -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(
|
||||
<table className='w-1/2 table bg-primary text-primary-content m-auto'>
|
||||
|
Loading…
Reference in New Issue
Block a user