Sha256: 1a4b29caf87eb7d1cf807d1db8c3cec7b5cca882e81f9dc21c500ca314a5668d
Contents?: true
Size: 587 Bytes
Versions: 1
Compression:
Stored size: 587 Bytes
Contents
require "goose_game/cell" module GooseGame class GameBoard WINNING_CELLS = [63] BRIDGE_CELLS = [6] GOOSE_CELLS = [5, 9, 14, 18, 23, 27] def [](n) cells.fetch(n) { Cell::Bounce.new(n, self) } end def cells @cells ||= (0..FINISH).reduce({}) { |acc, n| acc[n] = Cell::Base.new(n, self); acc }.tap do |cells| WINNING_CELLS.each { |n| cells[n] = Cell::Winning.new(n, self) } BRIDGE_CELLS.each { |n| cells[n] = Cell::Bridge.new(n, self) } GOOSE_CELLS.each { |n| cells[n] = Cell::Goose.new(n, self) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
goose_game-1.0.0 | lib/goose_game/gameboard.rb |