Advertisement
NastySwipy

Coding 101 Exam - 24 April 2016 - 05. STOP Sign

Feb 11th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. $n = intval(readline());
  3. echo str_repeat(".", $n + 1) . str_repeat("_", $n * 2 + 1) . str_repeat(".", $n + 1) . "\n";
  4. for ($i = 1, $j = 0; $i <= $n; $i++, $j++) {
  5.     echo str_repeat(".", $n + 1 - $i) . "//" . str_repeat("_", $n * 2 - 1 + $j * 2) . "\\" . "\\" . str_repeat(".", $n + 1 - $i) . "\n";
  6. }
  7. echo "//" . str_repeat("_", $n * 2 - 3) . "STOP!" . str_repeat("_", $n * 2 - 3) . "\\" . "\\" . "\n";
  8. for ($i = 0, $j = 1; $i < $n; $i++, $j++) {
  9.     echo str_repeat(".", $i) . "\\" . "\\" . str_repeat("_", $n * 4 - $i - $j) . "//" . str_repeat(".", $i) . "\n";
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement