fork(2) download
  1. <?php
  2.  
  3.  
  4. $phrase = "ABCDEFGHJIKLMNOPQRSTUVWXYZABCDEFGHIJ";
  5. $phraseLength = mb_strlen($phrase);
  6.  
  7. $fromAngle = -80;
  8. $toAngle = 260;
  9. $radius = 12.5;
  10.  
  11. $height = 30;
  12. $centerX = 40;
  13. $centerY = 15;
  14.  
  15. $screen = [];
  16. for($y = 0;$y<$height;$y++){
  17. $screen[$y] = array_fill(0,80," ");
  18. }
  19. $phraseArray = preg_split('//', $phrase, -1, PREG_SPLIT_NO_EMPTY);;
  20. for($x = 0;$x<$phraseLength;$x++){
  21. $lk = $radius * cos((((360/$phraseLength)*($x+1))*(M_PI/180)));
  22. $ko = $radius * sin((((360/$phraseLength)*($x+1))*(M_PI/180)));
  23. $screen[$centerY-round($lk)][round($ko)*2.7+$centerX] = $phraseArray[$x];
  24. }
  25. for($y = 1;$y<$height;$y++){
  26. echo "| ";
  27. for($x = 1;$x<80;$x++){
  28. echo $screen[$y][$x];
  29. }
  30. echo "\n";
  31. }
Success #stdin #stdout 0.02s 25424KB
stdin
Standard input is empty
stdout
|                                                                                  
|                                          J                                       
|                               H    I          A    B                             
|                         G                                C                       
|                    F                                          D                  
|                                                                                  
|               E                                                     E            
|                                                                                  
|            D                                                          F          
|                                                                                  
|         C                                                                G       
|                                                                                  
|         B                                                                H       
|                                                                                  
|      A                                                                      J    
|                                                                                  
|         Z                                                                I       
|                                                                                  
|         Y                                                                K       
|                                                                                  
|            X                                                          L          
|                                                                                  
|               W                                                     M            
|                                                                                  
|                    V                                          N                  
|                         U                                O                       
|                               T    S          Q    P                             
|                                          R                                       
|