Created
November 20, 2021 04:37
-
-
Save pfgithub/4d035ff8ce719b4008b3b538fca00486 to your computer and use it in GitHub Desktop.
\///\/\ /\//\\/\//\ /\\/\//\\ \\// /// //\/\\
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// /\ / \ \/\ /\/\ /\/ \/ \/\/ | |
// | |
// / i, /\ a, /\/ n, /\/\ m | |
// \ i, \/ v, \/\ h, \/\/ w | |
const swslash = { | |
a: "/\\", i: "/", m: "/\\/\\", n: "/\\/", | |
}; | |
const swback = { | |
i: "\\", h: "\\/\\", v: "\\/", w: "\\/\\/", | |
}; | |
const matches = (w) => { | |
mflp: for(const schar of ["/", "\\"]) { | |
let res = schar; | |
for(const char of [...w.toLowerCase()]) { | |
const sl = res.slice(-1) === "/" ? swslash : swback; | |
if(!sl[char]) continue mflp; | |
res += sl[char]; | |
} | |
return res.substr(1); | |
} | |
} | |
console.log(document.body.textContent.split("\n").filter(matches).join("\n")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment