Many of you may have interacted with people from Russia on the internet at some point, and a subset of you may have noticed the slightly odd method they have of expressing themselves.
e.g. деинсталляция игра нуб))) - (forgive the google translate)
where the ))) are added for emphasis on the previous statement, I have been working on a theory that the ratio of )'s to the rest of the string is directly proportional to the amount of implied emphasis, however I oftentimes find it difficult to compute the ratio on the fly, as I am also trying to cope with a slew of abuse, so I would like the shortest possible code to help me calculate what the resulting string should be, for a value of enthusiasm between 0 and 500%, given the original, unenthusiastic string, this will aid my research greatly as i will not have to type out bulky scripts every time I wish to test my hypothesis.
so, the challenge:
write a full program or function, which, provided two arguments, a string of unknown length, and a number, in either integer format (between 0 and 500) or in decimal format (between 0 and 5, with 2 points of accuracy) will
- return/display the original string, suffixed with a number of
)'s - the number will be the calculated as a ratio of the input number to the string length.
- so if the number 200, or 2.00 was provided, 200% of the string must be suffixed as
)'s - the number of brackets rounded to in decimal situations does not matter.
- script is required to support Printable ASCII characters.
- only has to support one input number format, of your choice.
examples:
"codegolf" 125 = codegolf))))))))))
"codegolf" 75 = codegolf))))))
"noob team omg" 0.5 = noob team omg))))))
"hi!" 4.99 = hi!)))))))))))))))
example code (powershell) (with decimal input):
Function Get-RussianString ([string]$InputStr,[decimal]$Ratio){
$StrLen = $InputStr.Length
$SuffixCount = $StrLen * $Ratio
$Suffix = [string]::New(")",$SuffixCount)
return $InputStr + $Suffix
}
Get-RussianString "codegolf" 0.5
codegolf))))
this is code-golf so shortest code wins!

('s in TI-BASIC... – 12Me21 14 hours ago)is reduced emoticon:). It is used very common between young people as far as I know. – talex 14 hours ago)is not an emphasis, it is simply the smiley. As far as I know, it is harder to type:when using Russian keyboard layout, therefore they smile without eyes. – Juris 14 hours ago