6 kyu
ASCII Fun #5: Days in Prison
54zruF
Description:
Days in Prison
Given an integer n (0<=n<=500)
, return a string
to visualize the days in prison in the following format:
| |||| |||/
| |||| ||/|
daysInPrison(1) => | daysInPrison(4) => |||| daysInPrison(5) => |/||
| |||| /|||
|||/ |||/ |||/ |||/ |||/ |
||/| ||/| ||/| ||/| ||/| |
daysInPrison(26) => |/|| |/|| |/|| |/|| |/|| |
/||| /||| /||| /||| /||| |
|||/ |||/ |||/ |||/ |||/ |||/ |||/ |||/ |||/ |||/
||/| ||/| ||/| ||/| ||/| ||/| ||/| ||/| ||/| ||/|
|/|| |/|| |/|| |/|| |/|| |/|| |/|| |/|| |/|| |/||
/||| /||| /||| /||| /||| /||| /||| /||| /||| /|||
daysInPrison(56) =>
|||/ |
||/| |
|/|| |
/||| |
I hope you got the idea.
Rules & Notes
- The first four strokes consists of 4 vertical
|
- The fifth strokes crosses the first vertical ones from the right upper corner to the left bottom corner with
/
- The 5's are splitted by a tab in each row. You can use \t to split them
- Every Row can contain a maximum of 50 strokes
- Every Row is splitted by an empty line (double newline) => \n\n
- The maximum integer which will be tested is 500, so there will be a maximum of 10 rows
- Return "" when n is 0
You can use the preloaded print function to output a pretty version of your solution =]
ASCII Art
Fundamentals
Similar Kata:
Stats:
Created | Nov 14, 2017 |
Published | Nov 16, 2017 |
Warriors Trained | 153 |
Total Skips | 1 |
Total Code Submissions | 477 |
Total Times Completed | 54 |
JavaScript Completions | 54 |
Total Stars | 10 |
% of votes with a positive feedback rating | 98% of 23 |
Total "Very Satisfied" Votes | 22 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 3 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |