Advertisement
krot

ASCII art circle

Nov 30th, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. $radius=12;
  4. $w = 3;
  5. for ($y = -$radius; $y <= $radius; $y++) {
  6.      for ($x = -$radius; $x <= $radius; $x++) {
  7.          $edge = ($x*$x + $y*$y) /  $radius - $radius;
  8.          if ($edge > - $w*4/3 && $edge < 1) {
  9.               echo "**";
  10.           }else{
  11.               echo "__";     
  12.           }  
  13.      }
  14.     echo "</br>";
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement