6 kyu
Old Mobile Display
97 of 207mmalkavian
Description:
In this Kata, you need to simulate an old mobile display, similar to this one:
***************************
* *
* *
* CodeWars *
* *
* *
* Menu Contacts *
***************************
Input Parameters:
- number of characters for width (
n
) - height-to-width ratio in percentage (
p
)
Example:
if n=30
and p=40
, then display will be 30 characters large and its height will be 40% of n.
Rules and Notes:
- the border, as you can see, is filled with
*
; - the rounding of divisions and float numbers is always by the integer (
1.2
,1.5
,1.9
they are always reduced to1
), keep this in mind when you calculate proportions; for Python: always multiply first, then divide. - the menus
Menu
andContacts
are always in the second last line, at 1 character distance respectively from the left and from the right border; - the
CodeWars
logo is always in the middle horizontally and in thehalf-1
line vertically; - the width
n
must be always at least 20 characters and the percentagep
must be always at least 30%, take care of this (otherwise menus won't likely fit). - random tests might get big and percentages might be higher than 100;
OFF-TOPIC before Examples:
A bit of advertisement for an old unnoticed Kata that I translated from Python to Javascript: Character Counter and Bars Graph
Examples:
- mobileDisplay(30,40):
******************************
* *
* *
* *
* *
* CodeWars *
* *
* *
* *
* *
* Menu Contacts *
******************************
- mobileDisplay(25,50):
*************************
* *
* *
* *
* *
* CodeWars *
* *
* *
* *
* *
* Menu Contacts *
*************************
Strings
ASCII Art
Fundamentals
Similar Kata:
Stats:
Created | Dec 12, 2016 |
Published | Dec 12, 2016 |
Warriors Trained | 645 |
Total Skips | 27 |
Total Code Submissions | 2459 |
Total Times Completed | 207 |
Python Completions | 97 |
JavaScript Completions | 75 |
Java Completions | 54 |
Total Stars | 29 |
% of votes with a positive feedback rating | 83% of 76 |
Total "Very Satisfied" Votes | 55 |
Total "Somewhat Satisfied" Votes | 16 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |