05.11.2015, 11:41
(
Последний раз редактировалось Macluawn; 05.11.2015 в 17:10.
)
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.
Not tested in any way whatsoever.
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);
}