Skip to content

Instantly share code, notes, and snippets.

@monokaijs
Created January 2, 2019 05:51
Show Gist options
  • Save monokaijs/1850891509268a3431f868dc21646353 to your computer and use it in GitHub Desktop.
Save monokaijs/1850891509268a3431f868dc21646353 to your computer and use it in GitHub Desktop.
Vẽ cái bánh chưng phong cách coder
<?php
$size = 13;
for ($i = 1; $i <= $size; $i++) {
for ($j = 1; $j <= $size; $j++)
echo ($j == round($size/2) || $i == round($size/2) || $j == 1 || $i == 1 || $i == $size || $j == $size || $i == $j || $i == ($size - $j + 1) || $j == ($size - $i + 1))?"*": " ";
echo PHP_EOL;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment