Re:Show HN: Wordle over DNS
by garaetjjte on Saturday February 19, 2022 @10:04AM
(#30397625)
It would be better if it just represented replies as ASCII chars to avoid perl postprocessing. Most terminals probably doesn't display colored emoji anyway.
[ Parent
| on HN ]
Interestingly I just tried it on Windows. For me Windows Terminal managed emoji, but only the green square! (After running “chcp 65001”)
However the unescaping isn’t needed, nslookup on Windows just outputs the raw data. Makes me wonder if I could just use ANSI terminal escape sequences.
Re:Show HN: Wordle over DNS
by testplzignore on Saturday February 19, 2022 @06:49PM
(#30401694)
Here's an emoji-less version that prints correctly-placed characters in uppercase, incorrectly-placed characters in lowercase, and incorrect characters as spaces. Gotta love bitmask tricks.
wd() { dig +short txt $1.example.wd.ip.wtf | head -n1 | perl -pe's/"//g;s/\\226\\172\\156/ /g;s/\\240\\159\\159\\168/chr(255)/eg;s/\\240\\159\\159\\169/chr(223)/eg' | perl -pe'$_&=lc("'$1'")'; }