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

Stats:

CreatedMar 16, 2016
PublishedMar 17, 2016
Warriors Trained363
Total Skips160
Total Code Submissions202
Total Times Completed55
JavaScript Completions48
Python Completions10
Total Stars5
% of votes with a positive feedback rating96% of 23
Total "Very Satisfied" Votes21
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes0
Total Rank Assessments3
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • jhoffner Avatar
  • smile67 Avatar
  • dfhwze Avatar
Ad