Skip to content

Instantly share code, notes, and snippets.

@allyburns
Created December 15, 2015 10:56
Show Gist options
  • Save allyburns/64b3fee418a8018cdd0c to your computer and use it in GitHub Desktop.
Save allyburns/64b3fee418a8018cdd0c to your computer and use it in GitHub Desktop.
My Blonde Code Golf entry for December 2015
<pre><?php
$n = $_GET['n'] ?: 5;
for ($i = 1; $i <= ($c = $n*2)*$n; $i++)
echo (($p = $i%$c) == 0) ? "\r\n" : ( $p >= ($max = $c-($min = $n-(ceil($i/$c)))) || $p <= $min ? ' ' : '*');
?></pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment