title: Complicated Star Pattern?
body: <p>Okay, so I have a unique problem that I ran into when trying to code a 5x3 star pattern. I can do the for loops to get the 5x3, that's easy. However I need something different than a square.</p>
  
  <p>We can have a maximum of 15 stars. So printing out a full block would look like this:</p>
  
  <pre><code>* * *
  * * *
  * * *
  * * *
  * * *
  </code></pre>
  
  <p>But we can pass in a parameter for the number of stars that we want. So let's pass in 11 instead of 15. We should get:</p>
  
  <pre><code>* * *
  * * *
  * * *
  * *
  </code></pre>
  
  <p>However, with 11 as my parameter the output is like this: </p>
  
  <pre><code>* 
  * *
  * *
  *
  </code></pre>
  
  <p>It prints out the correct number of rows with the incorrect number of stars. I know why this is, and it's because of the modulus in my code. I also tried a different approach, which printed out one less row than needed. I am stuck and not sure where to go from here.</p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>&lt;?php
      $num = 11;
      $rows = ceil($num/3);
      $count - 0;
      for($j = 0; $j &lt; $rows; $j++){
          echo '&lt;div class="row-fluid"&gt;&lt;ul class="thumbnails"&gt;';
          for($i = $num%3; $i &lt; 3; $i++){
              echo '*';
              $count++;
          }
          $num-=$count;
          echo '&lt;/ul&gt;&lt;/div&gt;';
       }
  ?&gt;
  </code></pre>