vendor/gems/rubyzip-0.9.1/lib/quiz1/t/solutions/Thomas Leitner/solitaire.rb
# Generates a keystream for the given +length+.
Generates a keystream for the given +length+.
Generates a keystream for the given + length + .
def generate_keystream( length )
    deck = @deck.dup
    result = []
    while result.length != length
      deck.move_A
      deck.move_B
      deck.triple_cut
      deck.count_cut
      letter = deck.output_letter
      result << letter unless letter.nil?
    end
    result.join
  end
def generate_keystream ( length ) deck = @deck . dup result = [ ] while result . length != length deck . move_A deck . move_B deck . triple_cut deck . count_cut letter = deck . output_letter result << letter unless letter . nil? end result . join end
Generates a keystream for the given +length+.
Generates a keystream for the given + length + .
length
<not_specific>