Skip to content

Instantly share code, notes, and snippets.

@allcentury
Created November 10, 2014 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allcentury/618b90ffa1dec3bffde0 to your computer and use it in GitHub Desktop.
Save allcentury/618b90ffa1dec3bffde0 to your computer and use it in GitHub Desktop.
require 'pry'
class Queens
attr_reader :white, :black
def initialize
@board = build_board
@black = current_position('w')
@white = current_position('b')
end
def build_board
board = Array.new(8, Array.new(8))
board[0][3] = 'w'
board[7][3] = 'b'
board
end
def current_position(color)
@board.each_with_index do |row, i|
row.each_with_index do |col, j|
if col == color
binding.pry
end
end
end
end
end
Queens.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment