Algorithm for rank points
#3

A basic equation for that would be the following, where n is the level you want.
f(1) = 10
f(n) = f(n-1) + 10*(n-1)


A recursive function for it, although it could also use a loop.
pawn Код:
levelPoints(level)
{
    if(level == 0) return 0;
    if(level == 1) return 10;

    return levelPoints(level - 1) + 10(level-1);
}
Not tested in any way whatsoever.
Reply


Messages In This Thread
Algorithm for rank points - by MP2 - 05.11.2015, 11:22
Re: Algorithm for rank points - by Karan007 - 05.11.2015, 11:25
Re: Algorithm for rank points - by Macluawn - 05.11.2015, 11:41
Re: Algorithm for rank points - by MP2 - 05.11.2015, 11:43
Re: Algorithm for rank points - by Macluawn - 05.11.2015, 11:47
Re: Algorithm for rank points - by MP2 - 05.11.2015, 11:49
Re: Algorithm for rank points - by Macluawn - 05.11.2015, 11:55
Re: Algorithm for rank points - by MP2 - 05.11.2015, 12:05
Re: Algorithm for rank points - by Macluawn - 05.11.2015, 12:20
Re: Algorithm for rank points - by AbyssMorgan - 05.11.2015, 14:28

Forum Jump:


Users browsing this thread: 2 Guest(s)