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(":");
    }
 }

Recommended Answers

All 3 Replies

what exactly do you mean by 'a constant value that can be changed'?

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..

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.