Retired
Convert Pixels of an Image into Brightness Value (retired)
Description:
Hello!
In this kata you will be given a list containing a tuple for the rgb values of each pixel in an image. At the end of each row of pixels will be a 'new'
Example:
[(0, 0, 0), (255, 255, 255), (255, 255, 255), (255, 255, 255), (0, 0, 0), 'new',
(255, 255, 255), (0, 0, 0), (255, 255, 255), (0, 0, 0), (255, 255, 255), 'new',
(255, 255, 255), (255, 255, 255), (0, 0, 0), (255, 255, 255), (255, 255, 255), 'new',
(255, 255, 255), (0, 0, 0), (255, 255, 255), (0, 0, 0), (255, 255, 255), 'new',
(0, 0, 0), (255, 255, 255), (255, 255, 255), (255, 255, 255), (0, 0, 0), 'new']
Your job is to take each tuple of rgb values and turn them into a symbol depending on their brightness.
Example:
(255, 255, 255) --> '@'
(0, 0, 0) --> '.'
The brightness will be ranked from 1 to 12 values and the 'new'
will be marked as a '\n'
1 Brightness = '.'
2 Brightness = ','
3 Brightness = '-'
4 Brightness = '~'
5 Brightness = ':'
6 Brightness = ';'
7 Brightness = '='
8 Brightness = '!'
9 Brightness = '*'
10 Brightness = '#'
11 Brightness = '$'
12 Brightness = '@'
'new' = '\n'
The final result of the first example is this:
['.', '@', '@', '@', '.', '\n',
'@', '.', '@', '.', '@', '\n',
'@', '@', '.', '@', '@', '\n',
'@', '.', '@', '.', '@', '\n',
'.', '@', '@', '@', '.', '\n']
Have fun!
Algorithms
Logic
Similar Kata:
Stats:
Created | Oct 14, 2021 |
Warriors Trained | 11 |
Total Skips | 0 |
Total Code Submissions | 54 |
Total Times Completed | 5 |
Python Completions | 5 |
Total Stars | 0 |
% of votes with a positive feedback rating | 0% of 4 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 3 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 7 kyu |