This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LeafNode | |
attr_accessor :name | |
def initialize(name) | |
@id = name | |
end | |
def find_node_named(name) | |
if @id == name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Well | |
attr_accessor :next_well, :seeds, :owner | |
def initialize anOwner | |
self.seeds = 0 | |
self.owner = anOwner | |
end | |
def sow | |
current_seeds = self.seeds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Well | |
attr_accessor :next_well, :seeds, :game | |
def initialize game | |
self.seeds = 0 | |
self.game = game | |
self.game.wells << self | |
end | |
def sow |