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

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

Yo, future Java legend! Ready 2 crack the code & flex ur pattern skills? We’re diving into star patterns with a Kanye twist let’s get coding, ye style

·

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! ✌️