Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using RabbitMQ.Client;
using RaspberryPi.GPIO;
namespace ButtonPress
@thutch
thutch / leafNode.rb
Last active January 1, 2016 03:19
OO Recursive Search
class LeafNode
attr_accessor :name
def initialize(name)
@id = name
end
def find_node_named(name)
if @id == name
@thutch
thutch / ManacalaWell.rb
Created April 16, 2012 00:30
Mancala Object-Oriented Recursion example
class Well
attr_accessor :next_well, :seeds, :owner
def initialize anOwner
self.seeds = 0
self.owner = anOwner
end
def sow
current_seeds = self.seeds
@thutch
thutch / Kata.rb
Created March 27, 2012 01:28
Ruby Mancala
class Well
attr_accessor :next_well, :seeds, :game
def initialize game
self.seeds = 0
self.game = game
self.game.wells << self
end
def sow