Show HN: Find the Fox Posted by puzzledpenguin on Friday July 19, 2024 @06:00AM from the show-hn dept. https://wordnerd.co/findthefox/ ( 2 comments | 4 points | on HN )
function searchWord(grid, word) { const rows = grid.length; const cols = grid[0].length; const wordLength = word.length; let found = false;
}const gridContainer = document.querySelector('.grid.mb-30'); const gridElements = gridContainer.querySelectorAll('.letter'); const grid = []; const rows = 100; const cols = 10;
for (let i = 0; i < rows; i++) { const row = []; for (let j = 0; j < cols; j++) { row.push(gridElements[i * cols + j]); } grid.push(row); }
searchWord(grid, 'FOX');