Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $num = intval(readline());
- echo "@" . str_repeat(" ", $num - 2) . "@" . str_repeat(" ", $num - 2) . "@\n";
- echo "**" . str_repeat(" ", $num - 3) . "*" . str_repeat(" ", $num - 3) . "**\n";
- for ($i = 0; $i < $num / 2 - 2; $i++) {
- echo "*" . str_repeat(".", $i + 1) . "*" . str_repeat(" ", $num - 5 - 2 * $i)
- . "*" . str_repeat(".", 1 + 2 * $i) . "*" . str_repeat(" ", $num - 5 - 2 * $i)
- . "*" . str_repeat(".", $i + 1) . "*\n";
- }
- echo "*" . str_repeat(".", $num / 2 - 1) . "*" . str_repeat(".", $num & 1 ? $num - 2 : $num - 3)
- . "*" . str_repeat(".", $num / 2 - 1) . "*\n";
- echo "*" . str_repeat(".", $num / 2) . str_repeat("*", $num & 1 ? $num / 2 - 1 : $num / 2 - 2)
- . "." . str_repeat("*", $num & 1 ? $num / 2 - 1 : $num / 2 - 2) . str_repeat(".", $num / 2) . "*\n";
- echo str_repeat("*", $num * 2 - 1) . "\n" . str_repeat("*", $num * 2 - 1);
Advertisement
Add Comment
Please, Sign In to add comment