Java program to draw pattern of Indian Map
Java Program to draw Indian Map Pattern.
Source Code for the Indian Map Pattern
Source Code for the Indian Map Pattern
public class Indiamap
{
public static void main(String[] args)
{
int i,j;
for (i=0;i<=40;i++ )
{
for(j=0;j<=34;j++)
{
if( (i==4&&(j>=8&&j<=11)) ||
(i==5&&(j>=7&&j<=12)) ||
(i==6&&(j>=9&&j<=15)) ||
(i==7&&(j>=8&&j<=15)) ||
(i==8&&(j>=9&&j<=14)) ||
(i==9&&(j>=10&&j<=14)) ||
(i==10&&(j>=10&&j<=13)) ||
(i==11&&(j>=10&&j<=14)) ||
(i==12&&(j>=9&&j<=15)) ||
(i==13&&((j>=8&&j<=14)||(j>=32&&j<=33))) ||
(i==14&&((j>=7&&j<=15)||(j>=31&&j<=34))) ||
(i==15&&((j>=6&&j<=17)||
(j==25)||(j>=29&&j<=34)))||
(i==16&&((j>=4&&j<=20)||
(j==25)||(j>=28&&j<=33)))||
(i==17&&(j>=4&&j<=32)) ||
(i==18&&((j>=5&&j<=25)||
(j>=27&&j<=32)))|| (i==19&&((j>=5&&j<=24)||
(j>=30&&j<=31)))|| (i==20&&((j>=2&&j<=25&&j!=4)||(j>=29&&j<=31)))|| (i==21&&((j>=1&&j<=26)||(j>=30&&j<=31)))|| (i==22&&((j>=3&&j<=25)||(j>=31&&j<=31)))|| (i==23&&((j>=2&&j<=24&&j!=5)||(j==31)))|| (i==24&&(j>=3&&j<=23&&j!=5)) || (i==25&&(j>=5&&j<=22&&j!=5)) || (i==26&&(j>=7&&j<=21)) || (i==27&&(j>=8&&j<=20)) || (i==28&&(j>=8&&j<=19)) || (i==29&&(j>=8&&j<=18)) || (i==30&&(j>=8&&j<=17)) || (i==31&&(j>=9&&j<=16)) || (i==32&&(j>=9&&j<=16)) || (i==33&&(j>=10&&j<=16)) || (i==34&&(j>=10&&j<=15)) || (i==35&&(j>=10&&j<=15)) || (i==36&&(j>=11&&j<=15)) || (i==37&&(j>=11&&j<=14)) || (i==38&&(j>=11&&j<=14)) || (i==39&&(j>=12&&j<=13)) || (i==40&&(j>=12&&j<=12)) )
System.out.print("!!");
else System.out.print(" ");
}
System.out.println();
}
}
}
{
public static void main(String[] args)
{
int i,j;
for (i=0;i<=40;i++ )
{
for(j=0;j<=34;j++)
{
if( (i==4&&(j>=8&&j<=11)) ||
(i==5&&(j>=7&&j<=12)) ||
(i==6&&(j>=9&&j<=15)) ||
(i==7&&(j>=8&&j<=15)) ||
(i==8&&(j>=9&&j<=14)) ||
(i==9&&(j>=10&&j<=14)) ||
(i==10&&(j>=10&&j<=13)) ||
(i==11&&(j>=10&&j<=14)) ||
(i==12&&(j>=9&&j<=15)) ||
(i==13&&((j>=8&&j<=14)||(j>=32&&j<=33))) ||
(i==14&&((j>=7&&j<=15)||(j>=31&&j<=34))) ||
(i==15&&((j>=6&&j<=17)||
(j==25)||(j>=29&&j<=34)))||
(i==16&&((j>=4&&j<=20)||
(j==25)||(j>=28&&j<=33)))||
(i==17&&(j>=4&&j<=32)) ||
(i==18&&((j>=5&&j<=25)||
(j>=27&&j<=32)))|| (i==19&&((j>=5&&j<=24)||
(j>=30&&j<=31)))|| (i==20&&((j>=2&&j<=25&&j!=4)||(j>=29&&j<=31)))|| (i==21&&((j>=1&&j<=26)||(j>=30&&j<=31)))|| (i==22&&((j>=3&&j<=25)||(j>=31&&j<=31)))|| (i==23&&((j>=2&&j<=24&&j!=5)||(j==31)))|| (i==24&&(j>=3&&j<=23&&j!=5)) || (i==25&&(j>=5&&j<=22&&j!=5)) || (i==26&&(j>=7&&j<=21)) || (i==27&&(j>=8&&j<=20)) || (i==28&&(j>=8&&j<=19)) || (i==29&&(j>=8&&j<=18)) || (i==30&&(j>=8&&j<=17)) || (i==31&&(j>=9&&j<=16)) || (i==32&&(j>=9&&j<=16)) || (i==33&&(j>=10&&j<=16)) || (i==34&&(j>=10&&j<=15)) || (i==35&&(j>=10&&j<=15)) || (i==36&&(j>=11&&j<=15)) || (i==37&&(j>=11&&j<=14)) || (i==38&&(j>=11&&j<=14)) || (i==39&&(j>=12&&j<=13)) || (i==40&&(j>=12&&j<=12)) )
System.out.print("!!");
else System.out.print(" ");
}
System.out.println();
}
}
}
Comments
Post a Comment