Find Jobs
Hire Freelancers

Construct Javascript function for prize distribution

$50 USD

进行中
已发布超过 8 年前

$50 USD

货到付款
We need a Javascript function developed for a prize distribution calculation between a variable number of users. The prize users receive should progressively increase based on their rank in the leaderboard. I will explain the structure of the function below and will try to be as detailed as possible. However, feel free to ask any questions you might have. This function need to accept a couple of parameteres, and the return value of the function must be an array of prize values. The function should look like this: function prizeDistribution(totalPrizeValue, amountOfWinners, distributionSpread, returnInt = false) { ... Javascript math magic here ... } Please write "I understand" in your bid to verify that you have read and understood my project description. The variables inside the function is explained below: totalPrizeValue: This is the prize amount that must be distributed between the winners. totalPrizeValue will always be an interger. amountOfWinners: This is the amount of users that the prize amount should be distributed to. amountOfWinners will always be an interger. distributionSpread: This is the spread which determines how much bigger the first prize is than the second etc. Since you are doing the math calculations, you will decide if it makes sense for the distributionSpread variable to be an int or a float number. returnInt = false: this parameter decides whether the return values in the array should be intergers or float numbers. If true, then it must use [login to view URL](number); to calculate interger.
项目 ID: 8274075

关于此项目

8提案
远程项目
活跃9 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
8威客以平均价$51 USD来参与此工作竞价
用户头像
I understand .........................................................................................
$50 USD 在1天之内
5.0 (33条评论)
5.4
5.4
用户头像
I understand This is first job for me.. I do it for fidback priority, money not main, not important in first time.. Thank You..
$50 USD 在2天之内
0.0 (0条评论)
0.0
0.0
用户头像
A proposal has not yet been provided
$55 USD 在1天之内
0.0 (0条评论)
0.0
0.0
用户头像
Ok, I guess I understand, I just give some examples of how I think the function should work: prizeDistribution(15, 3, 1, true) = [6, 5, 4] prizeDistribution(15, 3, 7, true) = [12, 5, -2] <-- or maybe negative prices are not allowed? Then this would be [11, 4, 0] prizeDistribution(14, 3, 1, false) = [5.6666, 4.6666, 3.6666] prizeDistrubution(14, 3, 1, true) = [5, 4, 3] <-- or should this be something like [5, 5, 4] or [6, 5, 3] to get the right sum? Please clarify!
$50 USD 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

DENMARK的国旗
Aalborg, Denmark
5.0
16
付款方式已验证
会员自9月 18, 2012起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。