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 BoggleBoard | |
def initialize(board) | |
@board = board | |
end | |
def create_word(*coords) | |
coords.map { |coord| @board[coord.first][coord.last]}.join("") | |
end | |
def get_row(row) |
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
def hypotenuse side1, side2 | |
Math.sqrt(side1**2 + side2**2).to_f | |
end | |
# Mostly, symbols have that don't allow much change. Symbols are meant to be | |
# constant and have little to no variation. | |
# While strings have the flexibility to be manipulated and changed at will. | |
# Strings have many destructive menthods such as delete, gsub, and split |
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
def source_paths | |
Array(super) + | |
[File.join(File.expand_path(File.dirname(__FILE__)),'rails_root')] | |
end | |
gsub_file "Gemfile", /^gem\s+["']sqlite3["'].*$/,'' | |
gsub_file "Gemfile", /^gem\s+["']turbolinks["'].*$/,'' | |
gsub_file "Gemfile", /^gem\s+["']spring["'].*$/,'' | |
gem 'haml-rails' |