Class: Elus::Generator
- Inherits:
-
Object
- Object
- Elus::Generator
- Defined in:
- lib/elus/generator.rb
Overview
Rules Generators
Direct Known Subclasses
EmptyGenerator, Turn1Generator, Turn2Generator, Turn3Generator
Instance Method Summary collapse
- #generate_rules ⇒ Object
-
#permutate(string = '01!=') ⇒ Object
iterates through all permutations of string chars with 2 dots.
Instance Method Details
#generate_rules ⇒ Object
4 5 6 |
# File 'lib/elus/generator.rb', line 4 def generate_rules [] end |
#permutate(string = '01!=') ⇒ Object
iterates through all permutations of string chars with 2 dots
9 10 11 |
# File 'lib/elus/generator.rb', line 9 def permutate(string='01!=') string.split(//).product(['.'],['.']).map {|set| set.permutation.to_a.uniq}.flatten(1).map {|chars| chars.join} end |