Class: FlapCore
- Inherits:
-
Object
- Object
- FlapCore
- Defined in:
- lib/flapcore.rb
Class Method Summary collapse
Class Method Details
.generate ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/flapcore.rb', line 13 def generate fourletterwords = wordhunt password_first = selector(fourletterwords) password_second = rand(90)+10 password_third = selector(fourletterwords) balla_shotcalla = password_first, password_second, password_third balla_shotcalla.join end |
.selector(zoot) ⇒ Object
9 10 11 12 |
# File 'lib/flapcore.rb', line 9 def selector(zoot) index = rand(zoot.size) return zoot[index] end |
.wordhunt ⇒ Object
3 4 5 6 7 8 |
# File 'lib/flapcore.rb', line 3 def wordhunt word = File.open(File.join(File.dirname(__FILE__),'dictionary.txt'), "r").read.split(/\n/) word.select do |pear| pear.size == 4 end end |