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

Stats:

CreatedMar 14, 2016
PublishedMar 14, 2016
Warriors Trained1769
Total Skips113
Total Code Submissions2856
Total Times Completed886
JavaScript Completions293
C# Completions111
C++ Completions161
Python Completions327
C Completions32
Haskell Completions17
Total Stars44
% of votes with a positive feedback rating96% of 248
Total "Very Satisfied" Votes228
Total "Somewhat Satisfied" Votes20
Total "Not Satisfied" Votes0
Total Rank Assessments9
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • smile67 Avatar
  • Dentzil Avatar
  • JohanWiltink Avatar
  • Blind4Basics Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • Paul Robertson Avatar
Ad