fork(1) download
  1. import 'dart:io';
  2.  
  3. void main() {
  4. int n = 5;
  5. if(n%2 == 0){
  6. return;
  7. }
  8.  
  9.  
  10. int row = 3*n;
  11. int col = 2 *n;
  12. int spaceBefore = 1;
  13. int spaceAfter = 2*n-1;
  14. int rowmid = ((row+1)/2).round();
  15. int spaceBefore2 = n-1;
  16. int spaceAfter2 = n;
  17. int mid = 1;
  18. int mid2 = 2*n+2;
  19. print(mid2);
  20.  
  21. for(int i = 1; i<=row; i++){
  22. if(i<n){
  23. print("*"*spaceBefore + " "*spaceAfter);
  24. }else if(i==n){
  25. print("*"*n+ " "*n);
  26. }else if(i>n && i<rowmid){
  27. print(" "* spaceBefore2 + "*"*mid + " "*spaceAfter2);
  28. }else if(i==rowmid){
  29. print(" "* spaceBefore2 + "*"*mid + "e"*n);
  30. }else if(i<mid2){
  31. print(" "* spaceBefore2 + "*"*mid + " "*spaceAfter2);
  32. }
  33.  
  34.  
  35. }
  36.  
  37.  
  38.  
  39. }
Success #stdin #stdout 1.62s 128132KB
stdin
Standard input is empty
stdout
12
*         
*         
*         
*         
*****     
    *     
    *     
    *eeeee
    *     
    *     
    *