Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

120
Visualizações
guessing words(like $|eeP!ng,@s,d0G) using node.js I tried to use object with aliases:{keys} saved in txt file but
  1. My code will only guess fixed words ( less < 1000 )

  2. I want to store all words/array/list/object - content in separate file (any better option except .txt)

  3. I actually making a bot which reacts to fixed words only

I tried...

var word = '';

function guess(obj, arry) {
  var keys = Object.keys(obj);
  keys.forEach((key) => {
    var inKey = key.split(/,\s?/);
    inKey.forEach((l) => {
      l == arry[0] && (word += inKey[0]) && guess(obj[key], arry.slice(1));
    });
  });
}


var guessLetters = {
  "s, $, &, ʂ, ₰, ₷": {
    "l, |, ł, ʟ": {
      "e, ∃, ∊, £, €, ė, ɛ, ɘ , ə": {
        "e, ∃, ∊, £, €, ė, ɛ, ɘ , ə": {
          "p, ℗, ‽, ⁋, ₽, ₱, Þ, þ, ₽": "p"
        }
      }
    }
  },
  "a, @": {
    "s, $, &, ʂ, ₰, ₷": "s"
  }
};
var guessThis = "₰ʟ£ɛ‽";

guess(guessLetters, guessThis.split(''));
console.log(word);

This solution I got after checking google and some related questions

problems...

  1. repetition of same type of key like 's' for 'sleep' and 's' for 'as'

  2. can't guess if 1 letter is missing in word

there is one more way I thought...

var translate = {
    "@, ª, ₳":"a",
    "₿, ฿":"b",
    "₵, ₡, ¢":"c",
    "£,  €, ɛ":"e",
    "₣":"f",
    respetive to all 27 letters
};

but...

  1. bot have to check the translated word in collection every time before reacting

ex. if I have CAT in my collection and user enter CAR then...

1st method will stop at R != T and ignore user

2nd method will translate whole CAR and also check (CAR in Collection) then ignore user

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda