Skip to content

Instantly share code, notes, and snippets.

@goodfoo
Forked from marcus-crane/wordle.js
Created December 16, 2021 16:12
Show Gist options
  • Save goodfoo/b4a5995f2517344ccc16585a4297ec7c to your computer and use it in GitHub Desktop.
Save goodfoo/b4a5995f2517344ccc16585a4297ec7c to your computer and use it in GitHub Desktop.
A small devtools sketch for reflecting the Daily Wordle grid as a group of emojis
let tiles = []
document.querySelector("game-app").$board.querySelectorAll("game-row").forEach(row => {
let rowTiles = [];
row.$tiles.forEach(tile => rowTiles.push(tile._state));
tiles.push(rowTiles)
})
for (let row of tiles) {
let rowString = ""
for (let tile of row) {
switch (tile) {
case 'absent':
rowString += '⬛️ '
break
case 'present':
rowString += '🟨 '
break
case 'correct':
rowString += '🟩 '
break
default:
// This will just print nothing for empty tiles
break
}
}
if (rowString) {
console.log(rowString)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment