Skip to content

Instantly share code, notes, and snippets.

@siraajul
Forked from sXakil/bd_map.c
Created November 30, 2019 10:56
Show Gist options
  • Save siraajul/a06c816a5d038a45f6d3831bafa23ca5 to your computer and use it in GitHub Desktop.
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.
#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