Facebook

Generate India's map using C-Program


This is one of smallest and most efficient code ever written. This code is just 16 lines long and will generate the India's map.


#include <stdio.h>
main()
{
    int a,b,c;
    int count = 1;
    for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\
    TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
    UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
    NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
    HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
    T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
    Hq!WFs XDt!" [b+++21]; )
    for(; a-- > 64 ; )
    putchar ( ++c=='Z' ? c = c/ 9:33^b&1);
    return 0;
}


Output is going to look like this -




See the code at work here - http://codepad.org/XGDEnKxj

Now next question is how this code generates this map? Here is the answer -
http://stackoverflow.com/questions/3533348/how-does-this-code-generate-the-map-of-india

Enjoy.


No comments:

Post a Comment