Hello 👋
I am Vinit Shahdeo, a Software Engineer from India. Yesterday on 15th August, India celebrated its 74th Independence Day. At midnight, I got an idea to write a code in JavaScript(Node.js) to generate the Map Of India. I've already seen code snippets in C/C++ which do the same but found nothing using JavaScript so far. With this spirit, I opened VSCode and started smashing my keys and finally ended up having a Node.js script to generate the Map of India.
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…
#IndependenceDayIndia #JavaScript #CodeNewbies #100DaysOfCode #GitHub04:15 AM - 15 Aug 2020
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.
vinitshahdeo / Map-of-India
A Node.js script to generate the Map of India in terminal
Map of India
A Node.js script to generate the Map of India in terminal
Quick Start 🚀
Open your terminal and run npm start
Setup ⚙️
npm install && npm start
Commands 🔥
-
npm run draw
: Prints Map of India🇮🇳 in the terminal -
npm run wish
: Prints a Happy Independence Day message in the terminal
Explained 🏗️
cd src && cat index.js
Navigate to src/
folder and check out index.js
.
For the binary version of the map, please checkout
republic day/index.js
.
cd republic\ day
node index.js
.--,_
[' '\
\ `''|
| ,]
`._ ].
| \
_/ -'\
,' ,'
_/' \ ,..-''L_
|--'' '-;__ |\ / .,'
\ `--.__,'_ '---- ,-'
`\ \`-'\__ ,|
,--;/ / .| ,/
\__ '| / /
…Say Hi on Twitter(@Vinit_Shahdeo)!
Thanks :)
Top comments (1)
This is with or without Kashmir?