6 kyu

MTV Cribs

365 of 763St3f4n

Description:

Task

Given n representing the number of floors build a beautiful multi-million dollar mansions like the ones in the example below:

     /\
    /  \
   /    \
  /______\  number of floors 3
  |      |
  |      |
  |______|

     /\
    /  \
   /____\
   |    |   2 floors
   |____|

     /\
    /__\    1 floor
    |__|

Note: whitespace should be preserved on both sides of the roof. Number of floors will go up to 30. There will be no tests with invalid input.

If you manage to complete it, you can try a harder version here.

Good luck!

Fundamentals
ASCII Art

Similar Kata:

More By Author:

Check out these other kata created by St3f4n

Stats:

CreatedNov 22, 2016
PublishedNov 22, 2016
Warriors Trained1878
Total Skips215
Total Code Submissions3125
Total Times Completed763
JavaScript Completions251
Crystal Completions6
Python Completions365
Ruby Completions44
CoffeeScript Completions10
PHP Completions136
Total Stars28
% of votes with a positive feedback rating93% of 187
Total "Very Satisfied" Votes163
Total "Somewhat Satisfied" Votes23
Total "Not Satisfied" Votes1
Total Rank Assessments8
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • St3f4n Avatar
  • GiacomoSorbi Avatar
  • smile67 Avatar
  • kazk Avatar
  • hobovsky Avatar
  • ejini战神 Avatar
  • Just4FunCoder Avatar
Ad