Skip to content

Instantly share code, notes, and snippets.

@leonmaia
Created January 31, 2014 11:42
Show Gist options
  • Save leonmaia/8730581 to your computer and use it in GitHub Desktop.
Save leonmaia/8730581 to your computer and use it in GitHub Desktop.
meu deus
def self.validate_literal_count
@array.count("D") < 2 && @array.count("L") < 2 && @array.count("V") < 2 &&
(@array.count("I") < 4 || ([email protected]("").match(/I{4}|X{4}|C{4}|M{4}/) && @array.count("I") < 5)) &&
(@array.count("X") < 4 || ([email protected]("").match(/I{4}|X{4}|C{4}|M{4}/) && @array.count("X") < 5)) &&
(@array.count("C") < 4 || ([email protected]("").match(/I{4}|X{4}|C{4}|M{4}/) && @array.count("C") < 5)) &&
(@array.count("M") < 4 || ([email protected]("").match(/I{4}|X{4}|C{4}|M{4}/) && @array.count("M") < 5))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment