Skip to content

Instantly share code, notes, and snippets.

require 'pry'
class Squares
def initialize(num)
@num = num
end
def square_of_sum
square_of_sum = 0

Queen Attack

In the game of chess, a queen can attack pieces which are on the same row, column, or diagonal.

A chessboard can be represented by an 8 by 8 array.

Write a program that positions two queens on a chess board and indicates whether or not they are positioned so that they can attack each other.