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