LoopsX Studio

Pick a pattern. Get the loops in and pseudocode.

38 figures, from first-year classics to advanced shapes. Change the size and the character, watch the pattern print row by row, then copy the code.

pattern.js
Pyramid
1const n = 5;
2
3for (let i = 1; i <= n; i++) {
4 let row = "";
5 for (let s = 1; s <= n - i; s++) {
6 row += " ";
7 }
8 for (let j = 1; j <= 2 * i - 1; j++) {
9 row += "*";
10 }
11 console.log(row);
12}
Outputn = 5
01

Pick

Squares, rhombus, triangles, pyramids, diamonds and advanced shapes. Solid or hollow.

02

Tune

Set the size and the character. The output follows the slider.

03

Copy

Watch the loops run row by row, then copy the code.