Find Jobs
Hire Freelancers

Construct Javascript function for prize distribution

$50 USD

W trakcie realizacji
Opublikowano ponad 8 lat temu

$50 USD

Płatne przy odbiorze
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.
Identyfikator projektu: 8274075

Informację o projekcie

8 ofert
Zdalny projekt
Aktywny 9 lat temu

Szukasz sposobu na zarobienie pieniędzy?

Korzyści ze składania ofert na Freelancer.com

Ustal budżet i ramy czasowe
Otrzymuj wynagrodzenie za swoją pracę
Przedstaw swoją propozycję
Rejestracja i składanie ofert jest bezpłatne
8 freelancerzy składają oferty o średniej wysokości $51 USD dla tej pracy
Awatar Użytkownika
I understand .........................................................................................
$50 USD w 1 dzień
5,0 (33 opinii)
5,4
5,4
Awatar Użytkownika
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 w 2 dni
0,0 (0 opinii)
0,0
0,0
Awatar Użytkownika
A proposal has not yet been provided
$55 USD w 1 dzień
0,0 (0 opinii)
0,0
0,0
Awatar Użytkownika
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 w 1 dzień
0,0 (0 opinii)
0,0
0,0

O kliencie

Flaga DENMARK
Aalborg, Denmark
5,0
16
Zweryfikowana metoda płatności
Członek od wrz 18, 2012

Weryfikacja Klienta

Dziękujemy! Przesłaliśmy Ci e-mailem link do odebrania darmowego bonusu.
Coś poszło nie tak podczas wysyłania wiadomości e-mail. Proszę spróbować ponownie.
Zarejestrowani Użytkownicy Całkowita Liczba Opublikowanych Projektów
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Wczytywanie podglądu
Udzielono pozwolenia na Geolokalizację.
Twoja sesja logowania wygasła i zostałeś wylogowany. Proszę, zalogować się ponownie.