Class: ShuffleAlgorithm
- Defined in:
- lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
writeonly
Sets the attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options=(value) ⇒ Object (writeonly)
Sets the attribute options
215 216 217 |
# File 'lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb', line 215 def (value) @options = value end |
Instance Method Details
#new_deck ⇒ Object
217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/quiz1/t/solutions/Jamis Buck/lib/cipher.rb', line 217 def new_deck deck = Deck.new cards = deck.to_a seed = ( @options[ "seed" ] || 0 ).to_i srand seed 7.times { cards.sort! { rand(3)-1 } } deck.cards = cards return deck end |