0

Hello, I created this little asci art in java, and am wondering how to implement a constant int value that can be changed to make the picture bigger/smaller etc..

these are my loops:

for(int i = 5;i>=0;i--){
    for(int j = 1;j<=i;j++){
	 System.out.print("P");
    }
    for(int j = 5;j>=i;j--){
	System.out.print(" ");
    }
    for(int j = 0;j<=i*2-1;j++){
	 System.out.print("M");
    }
    for(int j = 10;j>=i*2+1;j--){
         System.out.print("\\");
    }
    for(int j = 5;j>=i;j--){
	System.out.print(" ");
    }
    for(int j = 1;j<=i;j++){
	System.out.print(":");
    }
 }
2
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by stultuske
0

int h = 6;

I wanna incorporate that into my conditional statement in my for loops, so that it can be changed by user and it will adjust the size of the picture, im just not sure how to implement it into what I have right now..

0

well ... if the user is supposed to be able to change it, we 're talking about a variable, not a constant. I'm not sure how you could do that, unless you would ask for each iteration whether or not the value should be changed, even if it never has to change.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.