5 kyu
■□ Pattern □■ : Double-Spiral
48 of 55myjinxin2015
Description:
Task:
Complete the pattern using the special character:
■ □
In this kata, we need draw a Double-Spiral.
Rules:
- Parameter
m and n
It means m rows and n columns,■
and□
composition graphics of The Double-Spiral, m>0, odd number, n>1, even number. - Return a string, Connect each line by
'\n'
. abs(m - n) = 1
Examples:
m = 1, n = 2
(Please do not mind the black stripes, this is codewars description display effect, not perfect)
□■
m = 3, n = 2
□□
□■
■■
m = 3, n = 4
■□□□
■□■□
■■■□
m = 5, n = 4
■■■■
■□□□
■□■□
■■■□
□□□□
m = 5, n = 6
□■■■■■
□■□□□■
□■□■□■
□■■■□■
□□□□□■
m = 7, n = 6
□□□□□□
□■■■■■
□■□□□■
□■□■□■
□■■■□■
□□□□□■
■■■■■■
Games
ASCII Art
Puzzles
Similar Kata:
Stats:
Created | Mar 16, 2016 |
Published | Mar 17, 2016 |
Warriors Trained | 363 |
Total Skips | 160 |
Total Code Submissions | 202 |
Total Times Completed | 55 |
JavaScript Completions | 48 |
Python Completions | 10 |
Total Stars | 5 |
% of votes with a positive feedback rating | 96% of 23 |
Total "Very Satisfied" Votes | 21 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 3 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 6 kyu |