Find Jobs
Hire Freelancers

Construct Javascript function for prize distribution

$50 USD

Em Andamento
Publicado há mais de 8 anos

$50 USD

Pago na entrega
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 do Projeto: 8274075

Sobre o projeto

7 propostas
Projeto remoto
Ativo há 9 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
7 freelancers estão ofertando em média $51 USD for esse trabalho
Avatar do Usuário
I understand .........................................................................................
$50 USD em 1 dia
5,0 (33 avaliações)
5,4
5,4
Avatar do Usuário
A proposal has not yet been provided
$55 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
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 em 1 dia
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) DENMARK
Aalborg, Denmark
5,0
16
Método de pagamento verificado
Membro desde set. 18, 2012

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.