6 kyu
■□ Pattern □■ : Snake
Description:
# Task:
Complete the pattern, using the special character
■ □ ∷
In this kata, let's us draw a twisted snake.
# Rules:
- parameter
width:
The snake's body swing width, a positive even number. - parameter
height:
The height of the snake's body from top to bottom, a positive even number. - return a string, looks like a snake twisting the body. In order to maintain the shape, pad
∷
on the left side or right side(if necessary).
# Example:
snake(2,2) snake(4,2) snake(2,4) snake(8,4)
A snake egg? A newborn snake?
■□ ■□■□ ■□ ■□■□■□■□
□■ □■□■ □■ □■□■□■□■
■□ ∷∷∷∷∷∷■□
□■ ∷∷∷∷∷∷□■
According to the shape of the snake twisted
■□ is staggered pattern on the snake
snake(2,10) snake(4,10) snake(8,10) snake(8,18)
■□ ■□■□ ■□■□■□■□ ■□■□■□■□
□■ □■□■ □■□■□■□■ □■□■□■□■
■□ ∷∷■□ ∷∷∷∷∷∷■□ ∷∷∷∷∷∷■□
□■ ∷∷□■ ∷∷∷∷∷∷□■ ∷∷∷∷∷∷□■
■□ ■□■□ ■□■□■□■□ ■□■□■□■□
□■ □■□■ □■□■□■□■ □■□■□■□■
■□ ■□∷∷ ■□∷∷∷∷∷∷ ■□∷∷∷∷∷∷
□■ □■∷∷ □■∷∷∷∷∷∷ □■∷∷∷∷∷∷
■□ ■□■□ ■□■□■□■□ ■□■□■□■□
□■ □■□■ □■□■□■□■ □■□■□■□■
∷∷∷∷∷∷■□
∷∷∷∷∷∷□■
■□■□■□■□
□■□■□■□■
■□∷∷∷∷∷∷
□■∷∷∷∷∷∷
■□■□■□■□
□■□■□■□■
ASCII Art
Puzzles
Similar Kata:
Stats:
Created | Mar 11, 2016 |
Published | Mar 14, 2016 |
Warriors Trained | 253 |
Total Skips | 80 |
Total Code Submissions | 176 |
Total Times Completed | 52 |
JavaScript Completions | 52 |
Total Stars | 3 |
% of votes with a positive feedback rating | 94% of 26 |
Total "Very Satisfied" Votes | 24 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 5 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 6 kyu |