logoStarPatterns
Back to Patterns

Square Fill Pattern

Pattern Result

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

Code Implementation

Explanation

The Square Fill Pattern creates a solid square shape using asterisks (*). The algorithm uses nested loops to iterate through each row and column, placing an asterisk at every position. This is one of the simplest patterns and serves as a foundation for more complex patterns like the Square Hollow Pattern.