public static String outline(char c,int size, int spaces_from_left_margin,int spaces_from_top, int spaces_from_bottom){
StringBuffer sb = new StringBuffer();
for(int i = 0 ; i <spaces_from_top;i++) sb.append("\n");
for(int outer=0; outer < (size) ; outer++){
for(int sflm=0 ; sflm < spaces_from_left_margin ; sflm++){
sb.append(" ");
}
if(outer!=0 && outer!=(size-1)){
sb.append(c);
for(int inner=0; inner < (size -2) ; inner++){
sb.append(" ");
}
sb.append(c);
sb.append("\n");
}
else{
for(int inner=0; inner < size ; inner++){
sb.append(c);
}
sb.append("\n");
}
}
for(int i = 0 ; i <spaces_from_bottom;i++) sb.append("\n");
return sb.toString();
}
Saturday, April 9, 2011
draw square shape in command prompt java (no fill)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment