6 kyu
■□ Pattern □■ : Wave
293 of 886myjinxin2015
Description:
# Task:
Complete the pattern, using the special character
■ □
In this kata, we draw some histogram of the sound performance of ups and downs.
# Rules:
- parameter
waves
The value of sound waves, an array of number, all number in array >=0. - return a string,
■
represents the sound waves, and□
represents the blank part, draw the histogram from bottom to top.
# Example:
draw([1,2,3,4])
□□□■
□□■■
□■■■
■■■■
draw([1,2,3,3,2,1])
□□■■□□
□■■■■□
■■■■■■
draw([1,2,3,3,2,1,1,2,3,4,5,6,7])
□□□□□□□□□□□□■
□□□□□□□□□□□■■
□□□□□□□□□□■■■
□□□□□□□□□■■■■
□□■■□□□□■■■■■
□■■■■□□■■■■■■
■■■■■■■■■■■■■
draw([5,3,1,2,4,6,5,4,2,3,5,2,1])
□□□□□■□□□□□□□
■□□□□■■□□□■□□
■□□□■■■■□□■□□
■■□□■■■■□■■□□
■■□■■■■■■■■■□
■■■■■■■■■■■■■
draw([1,0,1,0,1,0,1,0])
■□■□■□■□
ASCII Art
Puzzles
Similar Kata:
Stats:
Created | Mar 14, 2016 |
Published | Mar 14, 2016 |
Warriors Trained | 1769 |
Total Skips | 113 |
Total Code Submissions | 2856 |
Total Times Completed | 886 |
JavaScript Completions | 293 |
C# Completions | 111 |
C++ Completions | 161 |
Python Completions | 327 |
C Completions | 32 |
Haskell Completions | 17 |
Total Stars | 44 |
% of votes with a positive feedback rating | 96% of 248 |
Total "Very Satisfied" Votes | 228 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 9 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |