Sha256: 68cbbfeb975944a27c0247bb2dde0325f9d729e212270293e5e72c20ecf16b3c

Contents?: true

Size: 325 Bytes

Versions: 5

Compression:

Stored size: 325 Bytes

Contents

module Hanoi
  module Jane
    class PaddedStacks < Array
      def initialize stacks, height = 7
        stacks.clone.each do |s|
          self.push PaddedStacks.pad s.clone, height
        end
      end

      def PaddedStacks.pad stack, height
        stack + Array.new(height - stack.length)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanoi-jane-0.4.0 lib/hanoi/jane/animation/padded_stacks.rb
hanoi-jane-0.3.4 lib/hanoi/jane/animation/padded_stacks.rb
hanoi-jane-0.3.3 lib/hanoi/jane/animation/padded_stacks.rb
hanoi-jane-0.3.1 lib/hanoi/jane/animation/padded_stacks.rb
hanoi-jane-0.3.0 lib/hanoi/jane/animation/padded_stacks.rb