I've created an interactive flowchart depicting your Java pattern code! The flowchart shows:
The flowchart visualizes:
You can zoom, pan, and drag nodes around to explore the flow. The animated edges show the direction of execution!
public class Patterns{
public static void main(String[] args){
int n = 8;
// outer loop handles rows
for (int i = 0; i < n; i++) {
// inner loop to print spaces.
for (int j = n - i; j > 1; j--) {
System.out.print(' ');
}
// inner loop to print stars.
for (int j = 0; j <= i; j++) {
System.out.print('* ');
}
// printing new line for each row
System.out.println();
}
}
}Analysed 200+ lines of code
Claude Sonnet 4.5