6 kyu

ASCII Fun #4: Build a pyramid

170 of 317zruF

Description:

Build a pyramid

You will get a string s with an even length, and an integer n which represents the height of the pyramid and your task is to draw the following pattern. Each line is seperated with "\n".

  • n will always be greater than 3. No need to check for invalid parameters
  • There are no whitespaces at the end of the lines

Example

build_pyramid("00-00..00-00", 7) should return:

                                    00-00..00-00
                              0000--0000....0000--0000
                        000000---000000......000000---000000
                   00000000----00000000........00000000----00000000
            0000000000-----0000000000..........0000000000-----0000000000
      000000000000------000000000000............000000000000------000000000000
00000000000000-------00000000000000..............00000000000000-------00000000000000

Serie: ASCII Fun

  • ASCII Fun #1: X-Shape
  • ASCII Fun #2: Funny Dots
  • ASCII Fun #3: Puzzle Tiles
  • ASCII Fun #4: Build a pyramid
  • ASCII Art

    Stats:

    CreatedJun 21, 2017
    PublishedJun 21, 2017
    Warriors Trained705
    Total Skips5
    Total Code Submissions1728
    Total Times Completed317
    JavaScript Completions170
    CoffeeScript Completions9
    Python Completions157
    Total Stars22
    % of votes with a positive feedback rating95% of 100
    Total "Very Satisfied" Votes91
    Total "Somewhat Satisfied" Votes8
    Total "Not Satisfied" Votes1
    Total Rank Assessments6
    Average Assessed Rank
    6 kyu
    Highest Assessed Rank
    6 kyu
    Lowest Assessed Rank
    6 kyu
    Ad
    Contributors
    • zruF Avatar
    • anter69 Avatar
    • ZED.CWT Avatar
    • Loukis Avatar
    Ad