Skip to content

Instantly share code, notes, and snippets.

@tranphuoctien
Created December 14, 2020 18:37
Show Gist options
  • Save tranphuoctien/b9d6206dfb3772356c7c7a59db7e6297 to your computer and use it in GitHub Desktop.
Save tranphuoctien/b9d6206dfb3772356c7c7a59db7e6297 to your computer and use it in GitHub Desktop.
Some challenge from CTO GHN at 2017
<?php
$sizePrint = 10;
for ($row=1; $row<=$sizePrint; $row++)
{
for ($column=1; $column<=$sizePrint; $column++)
{
$totalColRow = $row+$column;
$sizePadd1 = $sizePrint+1;
if ($row%$sizePrint <= 1 || $column%$sizePrint<= 1 || $row==$column || $totalColRow==$sizePadd1){
echo "#";
}else{
echo " ";
}
}
echo "\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment