Skip to content

Latest commit

 

History

History

returnPyramids

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Return pyramids

7 kyu link to kata
my solution

The task is very simple.

You must to return pyramids. Given a number n you print a pyramid with n floors

For example , given a n=4 you must to print this pyramid:

   /\
  /  \
 /    \
/______\ 

Other example, given a n=6 you must to print this pyramid:

     /\
    /  \
   /    \
  /      \
 /        \
/__________\

Another example, given a n=10, you must to print this pyramid:

         /\
        /  \
       /    \
      /      \
     /        \
    /          \
   /            \
  /              \
 /                \
/__________________\

Note: a line feed character is needed at the end of the string. Case n=0 should so return "\n".