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