Giter Club home page Giter Club logo

chess-pieces's Introduction

Chess tutor challenge

This two-part challenge will have you design an MVP feature for a web-based chess tutor, followed by an architectural discussion around building out a more complex feature.

We want to see your problem-solving approach, how you apply HTML, CSS and JavaScript and how you communicate technically.

We're not looking at your design skills, memory of syntax or knowledge of any specific framework or library. Keep this in mind as you code your solution, don't overthink the design and feel free to open up MDN or Google.

Part one - Legal moves

In this challenge we will work on a visualisation of how the pieces move on an International Chess board. Don't worry if you don't know how to play chess, we'll cover what you need to know.

There is some stub code to get started with, if you opt to use JavaScript to solve the challenge. Feel free to use as much or as little of this as you'd like.

1.1 Create the board

First create an empty chessboard.

The board will be square, with 8x8 evenly-sized tiles in an alternating black and white chequered effect. There should not be any gap between the tiles. The first square at the top left is empty/white. This is an exploded view to show the general effect:

□ ■ □ ■ □ ■ □ ■
■ □ ■ □ ■ □ ■ □
□ ■ □ ■ □ ■ □ ■
■ □ ■ □ ■ □ ■ □
□ ■ □ ■ □ ■ □ ■
■ □ ■ □ ■ □ ■ □
□ ■ □ ■ □ ■ □ ■
■ □ ■ □ ■ □ ■ □

1.2 Place a piece in the centre

Add a button above the board. When clicked, a castle/rook piece (♜) should appear on the board near the centre, in D5 position. The coding test provides images for this purpose. You do not need to show the grid numbers or letters in your visualisation, this is just for your reference.

8 □ ■ □ ■ □ ■ □ ■
7 ■ □ ■ □ ■ □ ■ □
6 □ ■ □ ■ □ ■ □ ■
5 ■ □ ■ ♜ ■ □ ■ □ <- this row, four from left
4 □ ■ □ ■ □ ■ □ ■
3 ■ □ ■ □ ■ □ ■ □
2 □ ■ □ ■ □ ■ □ ■
1 ■ □ ■ □ ■ □ ■ □
  a b c d e f g h

1.3 Stretch requirement if time allows - highlight legal moves

Highlight on the chess board the legal moves the castle/rook can make - it can move as many horizontal or vertical squares that are available. Since the "board" is empty, this means all the way to the edges.

□ ■ □ * □ ■ □ ■
■ □ ■ * ■ □ ■ □
□ ■ □ * □ ■ □ ■
* * * ♜ * * * *
□ ■ □ * □ ■ □ ■
■ □ ■ * ■ □ ■ □
□ ■ □ * □ ■ □ ■
■ □ ■ * ■ □ ■ □

Use any highlight style you wish.

Part two - Playing against a computer

Discuss how you would approach the following requirements:

In the next iteration, the chess tutor will have a game-play mode; where the user plays against a computer player.

  • An API will be provided that performs the computer's turns. It will accept the current game state and return the new game state with the computer player's move
  • The game-play mode will be activated by navigation at the top of the screen
  • An indicator panel will display the whether it is the computer or the player's turn, with a timer for how long the turn takes. A turn ends when a move is made
  • The user will make a move by selecting the piece to move, then selecting a valid location to move it to.

This would be built from scratch -- you are free to choose any framework, library or technique.

chess-pieces's People

Contributors

olthof avatar

Watchers

 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.