-
-
Save siraajul/a06c816a5d038a45f6d3831bafa23ca5 to your computer and use it in GitHub Desktop.
A simple program to print the map of Bangladesh based on the ASCII values of a generated string.
This file contains 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
#include <stdio.h> | |
int main() { | |
char str[] = "ED.GDAD.DLEB.COCC.CV.FS.HQ.JN.MP.Go.Cr.Cq.Cp.Fk.Jf.J`.I`.H`ID.J^HE.K^FG.N[ABCG.L`CG.MTBT.MUCS.NTDBCBAJ.NUBBHI.OTMI.OROI.OGDCSI.PE[I.RC[I.rBDB.rB.sB.tB"; | |
int c, i, j; | |
for(i = 0, j = 0; str[i] != '\0'; i++, j++) { | |
c = str[i]-64; | |
if(str[i] == 46 && ++j) putchar(10); | |
else if(j % 2 == 0) | |
while(c-- != 0) putchar(32); | |
else | |
while(c-- != 0) putchar(124); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment