by qqii · 7y ago · 0 comments
You've left out some important parts of the iq calculation, with the full equation being:
reactions = dogPos + Math.abs(menPos - womenPos) + Math.abs(whiteNegative - nonWhiteNegative) + kanyePos) / 4;
iq = Math.floor(15 * -((reactions - 0.0005) / 0.05) + 100);
if (iq < 100) {
thatPartBitSFX.play()
} else {
thatPartWaySFX.play()
}
Also amusingly rebulican percentage is calculated as: reactions = (dogPos + kanyePos + nonWhiteNegative) / 3;
republicanPct = 50 + 15 * ((reactions - 0.05) / 0.1),
And income is calculated as: reactions = (iq / 100 + republicanPct / 50 + dogPos) / 3
estimatedIncome = Math.floor(200000 * (reactions - 0.5) + 31099),
if (estimatedIncome < 31099) {
isPoorSFX.play()
} else {
isNotPoorSFX.play()
}The horrible magic numbers are outrageous because of the arbitrary nature of them. And for those of us who read the code we are supposed to notice that.
Hiding them behind constants would lessen the impact of that.