6 kyu

A for Apple

275 of 628sunboshan

Description:

  • Input: Integer n
  • Output: String

Example:

a(4) prints as

   A   
  A A  
 A A A 
A     A

a(8) prints as

       A       
      A A      
     A   A     
    A     A    
   A A A A A   
  A         A  
 A           A 
A             A

a(12) prints as

           A           
          A A          
         A   A         
        A     A        
       A       A       
      A         A      
     A A A A A A A     
    A             A    
   A               A   
  A                 A  
 A                   A 
A                     A

Note:

  • Each line's length is 2n - 1
  • Each line should be concatenate by line break "\n"
  • If n is less than 4, it should return ""
  • If n is odd, a(n) = a(n - 1), eg a(5) == a(4); a(9) == a(8)
ASCII Art
Fundamentals

More By Author:

Check out these other kata created by sunboshan

Stats:

CreatedAug 26, 2015
PublishedAug 26, 2015
Warriors Trained1812
Total Skips163
Total Code Submissions2957
Total Times Completed628
Ruby Completions65
Python Completions275
JavaScript Completions286
C Completions28
Total Stars55
% of votes with a positive feedback rating93% of 157
Total "Very Satisfied" Votes136
Total "Somewhat Satisfied" Votes19
Total "Not Satisfied" Votes2
Ad
Contributors
  • sunboshan Avatar
  • GiacomoSorbi Avatar
  • myjinxin2015 Avatar
  • Blind4Basics Avatar
  • trashy_incel Avatar
  • saudiGuy Avatar
Ad