logoStarPatterns
Back to Patterns

Alphabet N Pattern

Pattern Result

* *
** *
* * *
* * *
* * *
* **
* *

Code Implementation

Explanation

The Alphabet N Pattern creates a shape that resembles the letter N using asterisks. The pattern consists of two vertical lines on the left and right sides, with a diagonal line connecting them. For each row, stars are placed at the first position (left vertical line) and the last position (right vertical line). Additionally, a star is placed at a position that increases with each row to create the diagonal line from the top-left to the bottom-right. This creates the distinctive shape of the letter N with two vertical lines connected by a diagonal line.