<input id=i><p id=p><script> W=[ /* words list */ ]; w=W[new Date%W.length],g=6,onkeyup=e=>{e.which==13*W.includes (v=i.value)&&(a=[...w],p.innerHTML+=` `+[...v].map((e,n)=>e==a[n]?a[n]=0:e).map(e=>e?a[x=a.indexOf(e) ]=~x?"🟨":"⬛":"🟩")+v,i.value=v!=w&&--g?"":w)} </script> commented source codetests page
How to play:
- Enter a 5-letter word - Press Enter - Green = valid letter - Yellow = misplaced letter - Black = wrong letter - You have 6 guesses - Guesses must be valid words |
Play here:
|