Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created November 1, 2008 11:31
Show Gist options
  • Save ukstudio/21510 to your computer and use it in GitHub Desktop.
Save ukstudio/21510 to your computer and use it in GitHub Desktop.
module DartsLive
def self.rating(zero_one_stats, cricket_stats)
((0.2 * zero_one_stats - 6) + (5.0 * cricket_stats - 4.5)) / 2
end
module NumericExtension
def need_stats
{:zero_one => (self + 6) / 0.2, :cricket => (self + 4.5) / 5}
end
end
end
class Numeric
include DartsLive::NumericExtension
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment