Making a leet speak translator

前端 未结 2 1821
孤独总比滥情好
孤独总比滥情好 2021-01-22 12:41

This works as what I want:

var elite = document.getElementById(\"elite\"),
  leet = document.getElementById(\"leet\"),
  alphabets = {
    a: \"4\",
    b: \"8\"         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-22 13:16

    I'm looking for a way to convert words like "cool, "hacker" to "kewl" and "haxor" directly then convert the other letters with changelettrs()

    Currently you're converting letters, then converting words.

    Simply swap those operations around:

    changeWords();
    changeLetters();
    

    You will, of course, have to change the keys in words as they will now apply before letter conversion.

提交回复
热议问题