logoStarPatterns
Back to Patterns

Alphabet M Pattern

Pattern Result

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

Code Implementation

Explanation

The Alphabet M Pattern creates a shape that resembles the letter M using asterisks. The pattern consists of three parts: the top part with diagonal lines, the middle row with stars at the edges and middle, and the bottom part with vertical lines only. The top part creates the characteristic 'M' shape with stars placed to form diagonal lines that meet in the middle. The middle row has stars at the first, middle, and last positions. The bottom part has stars only at the first and last positions to form the vertical lines of the 'M'.