Skip to content

Instantly share code, notes, and snippets.

@youfoundron
youfoundron / introrx.md
Created September 17, 2016 23:01 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@youfoundron
youfoundron / 0.2.1-boggle_class_from_methods.rb
Created January 8, 2014 22:20 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
def initialize(board) # takes nested array and sets it to board attribute
@board = board
end
def create_word(*coords) # takes multiple arrays (representing individual coordinates), return string of the joined elements at the given coordinates
coords.map { |coord| @board[coord.first][coord.last]}.join("") # splat operator '*' let's the method take multiple paramaters as an array
end
def get_letter(row, col) # takes index of row, index of column; returns letter at coordinate