Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amahesh0501/7426388 to your computer and use it in GitHub Desktop.
Save amahesh0501/7426388 to your computer and use it in GitHub Desktop.
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
def initialize (board)
@board=board
end
def create_word(*coords)
puts coords.map { |coord| @board[coord.first][coord.last]}.join("")
end
def get_row(row)
@board[row-1]
end
def get_col(col)
@board.map { |row| row[col-1]}
end
def get_diagonal (row1, col1, row2, col2)
end
end
dice_grid = [["b", "r", "a", "e"],
["i", "o", "d", "t"],
["e", "c", "l", "r"],
["t", "a", "k", "e"]]
boggle_board = BoggleBoard.new(dice_grid)
# implement tests for each of the methods here:
# create driver test code to retrieve a value at a coordinate here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment