JSFiddle - React, Tailwind, and code Playground
by Timatnet
HTML
<pre>123</pre>
JavaScript
// w(j,t(i)) = degrade(w(j-1,t(i-1)))
// w(0,t(0)) = {score: 0 баллов, child: []}
// max(NetWorth(w(0,t(6))))
// NetWorth(w) = NetWorth(w(j,t(i))) = NetWorth({X баллов, ВЕТКА})
// ScoreSum(w) = PresonalScore(w) + sum(PersonalScore(w(j+1,t(i))))
//-PersonalScore(w(j,t(i)))*65*(tablePercent[PersonalScore(w(j,t(i)))]-1) + SumScore()
function clone(obj) { return jQuery.extend(true, {}, obj); /*JSON.parse(JSON.stringify(obj));*/ }
function tableScore(score) {
if(score < 10000) {
if(score < 7000) {
if(score < 4000) {
if(score < 2400) {
if(score < 1200) {
if(score < 600) {
if(score < 200) {
return 0;
} else {
return 0.03;
}
} else {
return 0.06;
}
} else {
return 0.09;
}
} else {
return 0.12;
}
} else {
return 0.15;
}
} else {
return 0.18;
}
} else {
return 0.21;
}
}
var newby;
newby = {
score: 0,
children: [],
money: 4000,
month_time_left: 20*8,
income: 0,
NVP: 0,
reqruitCount: 0,
motivateCount: 0,
current_month: 0,
reqruit: function(toWho) {
if((this.month_time_left < 10+10*toWho.motivateCount) || (this.money < 1000 + 1000*this.reqruitCount))
return;
this.money -= 1000 + 1000*this.reqruitCount;
this.month_time_left -= 10+10*toWho.motivateCount;
toWho.children.push(clone(newby));
...