Giter Club home page Giter Club logo

chess's Introduction

Given standard algebraic notation of the a chess board, write code that will:

Accept two parameters:

  1. Type of chess piece (Queen, Rook, Knight)
  2. Current position on a chess board (for example: d2)

Return: A list of all the potential board positions the given piece could advance to, with one move, from the given position, with the assumption there are no other piece on the board.

Rules:

  • No need to implement the solution for every piece type, but the solution must implement at least the following: Queen, Rook and Knight.
  • May not be use any external/non-core libraries: use only primitives and built-ins for the chosen language.
  • Please provide test coverage

Example: If the code is passed: "knight, d2", outout should be: "b1, f1, b3, f3, c4, e4"

Usage:

$ ruby main.rb knight d2

should generate output

f3, b3, f1, b1, e4, c4

chess's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.