'use client'; import React from 'react' import Bingo from './bingo' function FisherYatesShuffle(array:string[]):string[]{ for(let i = array.length - 1; i > 0; i--){ const j = Math.floor(Math.random() * (i + 1)); const temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } export default function BingoController(){ const [size, setSize] = React.useState(5); const buzzwords = ["Cloud", "Cyber", "Distruptive Technology", "AI", "Metaverse", "Gamification", "Web 2.0/3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Insert bullshit here] as a service", "Emerging Market", "Streamline"]; const [items, setItems] = React.useState(buzzwords); const sizeError = ((items.length % size) != 0); return( <>
setSize(s)}/>
3x3 4x4 5x5
setItems(FisherYatesShuffle(buzzwords))}>Regenerate
{sizeError &&
Warning: Mismatch between item count and size
} ); }