Mar 2, 2018 09:59 PM
(This post was last modified: Mar 2, 2018 10:01 PM by Computronium.)
Hello. I am new to Java and I am trying to make ASCII art using loops.
This is the shape I am trying to do:
This is my code I am using so far:
My code prints this:
Anybody think they can complete this? I am exhausted here. I would greatly appreciate it!
Thanks.
This is the shape I am trying to do:
Code
1 1
12 21
123 321
1234 4321
12345 54321
123456 654321
12345 54321
1234 4321
123 321
12 21
1 1This is my code I am using so far:
Code
public class Bowtie {
public static void main(String[] args)
{
for (int i = 0; i < 7; i++) { //this is the first loop. it will go 5 times and increase by 1 each time
for (int k = 1; k <= i; k++) { //prints out numbers
System.out.print(k);
}
for (int j = 0; j < i; j++) { //attempting to print spaces
System.out.print(" ");
}
System.out.println();
}
for (int main = 1; main < 6; main++) { //this is the lower loop. it will go 5 times and increase by 1 each time
for (int x = 5; x < main; x++)
System.out.print(main - 1);
System.out.println();
}
}
}My code prints this:
Code
1
12
123
1234
12345
123456Anybody think they can complete this? I am exhausted here. I would greatly appreciate it!
Thanks.



![[Image: ysilye.jpg]](https://my.mixtape.moe/ysilye.jpg)
![[Image: xiuavr.jpg]](https://my.mixtape.moe/xiuavr.jpg)
![[Image: tjpazx.jpg]](https://my.mixtape.moe/tjpazx.jpg)
![[Image: ypkpku.jpg]](https://my.mixtape.moe/ypkpku.jpg)
![[Image: jdieqw.jpg]](https://my.mixtape.moe/jdieqw.jpg)
![[Image: pbxjmw.jpg]](https://my.mixtape.moe/pbxjmw.jpg)