Hacker News new | ask | show | jobs
by genezeta 656 days ago
Given that you so generously keep the dictionary there, one can just open the console and paste:

    words.filter((word) => word.split('').every((letter) => "egtdrnq"].indexOf(letter) !== -1) && word.indexOf('d') !== -1 && word.length>3)
But, of course, that spoils the fun :)
1 comments

More generally (speed may need to be adjusted):

  var letters = $$('.hex').map((x)=>x.textContent.toLowerCase()).join('');
  var obLetter = $('.hex.yellow').textContent.toLowerCase();
  var sol = words.filter((word) => word.split('').every((letter) => letters.indexOf(letter) !== -1) && word.indexOf(obLetter) !== -1 && word.length>3);

  let tick = 0;
  let nextWord = ()=>{
    $('#textInput').value=sol[tick].toUpperCase();
    $('.enter-button').click();
    tick++;
    if(tick<sol.length) setTimeout(nextWord, 50);
  };
  setTimeout(nextWord, 30);