Day 4: Looping Through Patterns Like a Rockstar Kanye Style!

SowmiyaSowmiya
1 min read

1. The Classic Triangle

This pattern screams, "I’m the GOAT of basics." Kanye would approve.

How It Works:

  • Outer loop: Runs 5 times (one for each row).

  • Inner loop: Prints stars equal to the row number.

Kanye would say, "I’m not just a star. I’m a galaxy!" And this code? It's your gateway to one.

_______________________________________________________________________________________________________________

2. The Pyramid: Yeezy's Favorite

When you think pyramid, think Yeezy flexing at the top, shouting, “I’m a genius!” Here’s the pattern:

How It Works:

  • First inner loop: Prints spaces to align stars (because Kanye insists on perfection).

  • Second inner loop: Prints stars in an odd-numbered sequence.

_______________________________________________________________________________________________________________

3. The Reverse Pyramid: Because Kanye Never Looks Back

Life’s all about perspective. Flip that pyramid upside down:

Here’s the code for this masterpiece:

How It Works:

  • Same idea as the pyramid, but we start big and shrink Kanye’s ego... I mean, the stars.

Parting Words:
Star patterns are your first step toward coding greatness. In life and Java, always keep looping with confidence. Now go ahead and code like Kanye drops albums—nonstop and unapologetically. 🌟

Drop your favorite Kanye lyric (or Java bug) in the comments below! ✌️

5
Subscribe to my newsletter

Read articles from Sowmiya directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sowmiya
Sowmiya

Passionate Java coder with a knack for making programming fun through memes. Ready to support Kanye for President 2025!