level calculation
[engit/Iron-Munger.git] / lib / IronMunger / Calculate.pm
index ab01eca..43b7fe0 100644 (file)
@@ -9,7 +9,7 @@ use signatures;
 
 use Sub::Exporter -setup => {
   exports => [
-    qw(successful_sequential_posts days_remaining_to_post)
+    qw(successful_sequential_posts days_remaining_to_post level_for_post_count)
   ]
 };
 
@@ -64,4 +64,11 @@ sub days_remaining_to_post (@posts) {
   return check_both(\&check_time_remaining, @posts);
 }
 
+sub level_for_post_count($count) {
+  return 'paper' if $count < 4;
+  return 'stone' if $count < 12;
+  return 'bronze' if $count < 36;
+  return 'iron';
+}
+
 1;