-
-
Save toreriklinnerud/616996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count = 90 | |
total = 100 | |
%w(red amber green).map.with_index do |color, index| | |
color if ((index + 1)/ 3.0) > (count.to_f / total.to_f) | |
end.compact.first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ten points :)