'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-[Something]", "Distrupt[ive]", "AI", "Meta [Something]", "Gamification", "Web 2.0/3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Something] as a service", "Emerging [Something]", "Streamline", "Ecosystem", "Leverage", "Outside the Box", "Pivot", "Strategic", "Agile", "Smart Tech", "Data Warehouse", "Actionable Insights", "Holistic Approach", "Digital Transformation", "Growth Hacking"]; const [items, setItems] = React.useState(buzzwords); const sizeError = (items.length < size); return( <>
setSize(+s)}/>
3x3 4x4 5x5
setItems(FisherYatesShuffle(buzzwords))}>Regenerate
{sizeError &&
Warning: Mismatch between item count and size
} ); }