#!/usr/bin/perl -w use strict; # Average XP for a number of ++ votes, with no -- votes, given a NORM. my $votes = 50; my $NORM = 10.7453; my @val = (0, 1/3, 1/2, 2/3, 3/4, 1); my $xp = 0; foreach my $rep ( 1 .. $votes ) { foreach (1..$#val) { $xp += $val[$_], last if $rep <= $_ * $NORM; } } printf "XP = %.1f\n", $xp;