fork download
  1. <?php
  2. header("Content-Type: text/plain; charset=utf-8");
  3. ?>
  4. <?php
  5.  
  6. $text = 'В российском сегменте';
  7.  
  8.  
  9.  
  10. $len = mb_strlen($text);
  11. $circleRadius = $len / 2.5;
  12. $txt = preg_split("//u", $text, null, PREG_SPLIT_NO_EMPTY);
  13.  
  14.  
  15. $screen = array();
  16. for ($i = 0; $i <= $len * 4; $i++) {
  17. for ($k = 0; $k <= $len * 4; $k++) {
  18. $screen[$i][$k] = ' ';
  19. }
  20.  
  21. }
  22.  
  23. $corners = array();
  24. $corner = round(360 / $len, 2);
  25. $c = $corner;
  26.  
  27.  
  28. $i = 0;
  29. foreach ($txt as $letter) {
  30.  
  31. $x = (round(cos($c * M_PI / 180) * $circleRadius) + $circleRadius) * 2.4;
  32. $y = round(sin($c * M_PI / 180) * $circleRadius) + $circleRadius;
  33.  
  34.  
  35. $screen[$y][$x] = $letter;
  36.  
  37. $c += $corner;
  38.  
  39. }
  40. foreach ($screen as $v) {
  41.  
  42. echo implode("", $v) . "\n";
  43.  
  44. }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
 
               е      г    м                                                         
          с                     е                                                    
                                                                                     
                                    н                                                
м                                                                                    
                                                                                     
                                       т                                             
о                                                                                    
                                       е                                             
к                                                                                    
                                       В                                             
                                                                                     
с                                                                                    
                                                                                     
     й                                                                               
          и                     р                                                    
               с      с    о