- or download this
sub weight {
my $age = shift;
return $age / $FACTOR;
}
- or download this
$score = $item->totalVotes() * weight($item->age());
- or download this
$score = 0;
foreach $vote ($item->votes()) {
$score += $vote->value()
* weight($item->age() - $vote->age());
}