Skip to content

Instantly share code, notes, and snippets.

Keith Chong keitheous

Block or report user

Report or block keitheous

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View difference_of_squares.rb
require 'pry'
class Squares
def initialize(num)
@num = num
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.

You can’t perform that action at this time.