I hereby claim:
- I am madipally on github.
- I am madipallynaveen (https://keybase.io/madipallynaveen) on keybase.
- I have a public key ASA_1sDJQTzBHmmqHP98QEsj7m2OhlW33aEuh0frx4s59Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
class Chess | |
PIECES = ['knight','rook','queen'] | |
COLS = ['a','b','c','d','e','f','g','h'] | |
ROWS = [1,2,3,4,5,6,7,8] | |
KNIGHT_MOVES_ARR = [[-1,-2],[1,-2],[-2,-1],[2,-1],[-1,2],[1,2],[-2,1],[2,1]] | |
QUEEN_MOVES_ARR = [[1,1],[-1,-1],[1,-1],[-1,1],[0,1],[0,-1],[1,0],[-1,0]] | |
ROOK_MOVES_ARR = [[0,1],[0,-1],[1,0],[-1,0]] | |
def move_col(pos,count) |
require 'benchmark' | |
class MoveToTarget | |
COLS = ('a'..'h').to_a | |
ROWS = (1..8).to_a | |
def initialize | |
@knight_moves_arr = [[-1,-2],[1,-2],[-2,-1],[2,-1],[-1,2],[1,2],[-2,1],[2,1]] | |
@queen_moves_arr = [[1,1],[-1,-1],[1,-1],[-1,1],[0,1],[0,-1],[1,0],[-1,0]] |
require 'benchmark' | |
require_relative 'chess' | |
class ChessPieceMoves < Chess | |
def initialize | |
@moves =[] | |
end | |
def piece_move(piece,pos) |