Vinit Shahdeo@vinit_shahdeo👋 Happy Independence 🇮🇳 Day!
Here's something which I hacked last night - a @nodejs script to print #MapOfIndia in the terminal!
❤️ RTs are most welcome! 🤗
💙 Leave a ⭐️ here: github.com/vinitshahdeo/M…
In this article, I'm trying to explain the obfuscated code which does the magic.
const MAGIC_STRING = "TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!"
The above encoded string is basically a binary sequence converted to ASCII in which alternating characters stores how many times to draw space and how many times to draw an exclamation mark(
Here's the link to the GitHub repository.
Map of India
A Node.js script to generate the Map of India in terminal
Open your terminal and run
npm install && npm start
npm run draw: Prints Map of India
🇮🇳in the terminal
npm run wish: Prints a Happy Independence Day message in the terminal
cd src && cat index.js
src/ folder and check out
.--,_ [' '\ \ `''| | ,] `._ ]. | \ _/ -'\ ,' ,' _/' \ ,..-''L_ |--'' '-;__ |\ / .,' \ `--.__,'_ '---- ,-' `\ \`-'\__ ,| ,--;/ / .| ,/ \__ '| / / ./ _-, _| S@yaN \__/ / ,/ " | _/ | ,/ \ / | /.-' \ _/ : |…
Say Hi on Twitter(@Vinit_Shahdeo)!