Coder Social home page Coder Social logo

chess-board's Introduction

Chess Board

Author: Davee Sok

Overview

Construct a chessboard using numpy and matplotlib.

Links

Feature Tasks and Requirements

  • Render out chess boards with red and blue queens on them.
  • Chess board is an 8 by 8 grid of alternating black and white squares.
  • Each board will have one red and one blue queen at different coordinates.
  • In addition to displaying the board, identify if the queens are “under attack” based on their coordinates.

Implementation Notes

Define a ChessBoard class - should contain an 8x8 grid - Each cell in grid should have a color represented in RGB format. - black = (0,0,0) - white = (1,1,1) - blue = (0,1,1) - red = (1,.2,0)

  • should have add_red method that accepts a row and column as input which colors corresponding cell.
  • should have add_blue method that accepts a row and column as input which colors corresponding cell.
  • should have render method that displays the chess board on screen with red and blue shown in correct locations
  • should have is_under_attack method that return boolean if red is under attack by a blue piece horizontally, vertically or diagonally

Tools and Dependencies

  • Poetry
  • Numpy
  • Matplotlib
  • Jupyterlab

Getting Started

  • Clone down this repo
  • cd chess-board
  • poetry install
  • poetry shell

chess-board's People

Contributors

davees987 avatar

Watchers

 avatar

Forkers

ericmungai97

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.