Briefing
The difficulty of a Code Golf question can be calculated as such:
Where v
is the number of views a question has
and a
is the number of answers a question has
and ⌈x⌉ is the ceiling operator.
Also:
This question's current difficulty: ***
Task
Write a program that will take two integers (v and a)
and output the difficulty in asterisks (*)
.
The input can be in the form of an array, a seperated string or as seperate function arguments
Test Data
Views Answers Difficulty Program Output
163 2 2 **
548 22 1 *
1452 24 1 *
1713 37 1 *
4162 32 2 **
3067 15 3 ***
22421 19 10 **********
Example with pseudocode
v: 1713
a: 37
out = clamp(ceil(((v/a)/700)*10), 0, 10); // evaluates to 1
//program will output '*'
The shortest code in bytes wins! Trailing/ leading spaces are allowed.
/700 * 10
instead of/70
? \$\endgroup\$ – Kevin L Aug 17 '16 at 14:21