fork(4) download
  1. <?php
  2.  
  3. $phrase = mb_strtoupper("абвгдеёжзийклмнопрстуфхцчшщъыьэюя");
  4. $fromAngel = -80;
  5. $toAngel = 260;
  6. $radius = 12.5;
  7. $phraseLen = mb_strlen($phrase);
  8. $split = preg_split('//u', $phrase, 0, PREG_SPLIT_NO_EMPTY);
  9.  
  10. $height = 30;
  11. $centerX = 40;
  12. $centerY = 15;
  13. $screen = array();
  14. for ($q = 0; $q < $height; $q++){
  15. $screen[$q] = array_fill(0, 80, ' ');
  16. }
  17.  
  18. $rad = 360/$phraseLen*M_PI/180;
  19. $a = $fromAngel*M_PI/180;
  20. for ($q = 0; $q < $phraseLen; $q++){
  21. $a = $a + $rad;
  22. $x = $centerX + round($radius * sin($a));
  23. $y = $centerY + round($radius * cos($a));
  24. $screen[$y][$x] = $split[$q];
  25.  
  26. }
  27. foreach ($screen as $screen){
  28. echo implode(' ', $screen);
  29. }
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Ч     Ц   Х   Ф                                                                                                                                            Ш                     У                                                                                                                                    Щ                                                                                                                                                          Ъ                                 Т                                                                                                                                                                  С                                                                                                                      Ы                                                                                                                                                                                                        Р                                                                                                                Ь                                                                                                                                                                                                                                                                                                                             Э                                               П                                                                                                                                                                                                                                                                                                                             О                                                                                                              Ю                                                                                                                                                                                                              Н                                                                                                              Я                                                                                                                                                                                                                                                                                                                             А                                               М                                                                                                                                                                                                                                                                                                                           Л                                                                                                                  Б                                                                                                                                                                  В                                     К                                                                                                                                                                                                                                                                                           Г                             Й                                                                                                                                    Д                     И                                                                                                                                            Е   Ё     Ж   З