GithubHelp home page GithubHelp logo

chess_board's Introduction

Numpy Arrays

Submission pull request: #1


Developer: Kim Damalas

Created: 16 January 2020

Version 1.0

Class: seattle-py-401n2

Lab: 11


Description


Build a chessboard with arrays and pixe lart


Feature Tasks and Requirements


  1. Your job is to render out chess boards with red and blue queens on them.

  2. We’re keeping it really basic here so the only pieces are queens and each queen is represented by a blue or red square.

  3. Chess board is an 8 by 8 grid of alternating black and white squares. The queens are red and blue squares.

  4. Each board will have one red and one blue queen at different coordinates. In addition to displaying the board you’ll need to identify if the queens are “under attack” based on their coordinates.

  5. 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


Configuration and Technologies


The user must have Python and all associated dependencies installed. The project is run inline using a Jupyter notebook


Changes


16 Jan: files set up; grid coded; first PR


Testing


Testing accomplished using inline testing in chess_board.ipynb. The program must pass the provided tests given in the file as well as any custom tests coded by the developer

  1. queens on same row should be “under attack”

  2. queens on same column should be “under attack”

  3. queens on same diagonal should be “under attack”

  4. queens with any other coordinates should NOT be “under attack”


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.