Front-End Interview Exercises
- Make sure you have Git
>= 2.13.2
, Node.js>= 8.6.0
and Yarn package manager installed on your computer. - Fork and clone this repository locally.
- Run
yarn
to install all the dependencies. - Run
yarn start
to start the app in a new browser window (http://localhost:8080/). Each time you save changes to a file, the browser will reload with those changes.
You are given a React app that renders a Checkers board.
Modify the existing code to create a functional Checkers game, by implementing these user requirements:
- As a user, I want to move any piece to any space it is allowed to go, so that the board is correctly updated as a result of that move.
- If a piece is captured, it is removed from the board.
- If a piece reaches the opposite side, it becomes a king.
- The "movement" interaction is up to you. It can be with simple mouse clicks, drag-n-drop if you're up for a challenge, or even the keyboard if you wish.
- As a user, I want to be able to take turns alternating between two local human players, so that Player One takes as many turns as possible and then Player Two does the same and so on until the game ends.
- If a player is allowed to make multiple moves, they are allowed to do so before the other player moves again.
- If the next player can't make a move or has no more pieces, they lose.
The rules of Checkers are available here.
Note: This is an incomplete list of errors. Feel free to make a pull request or add issues if you run across any bugs or issues.
error: cannot spawn .git/hooks/pre-commit: No such file or directory on Windows
This error is caused by a requirement of Husky to be running git version 2.13.2 or later.
If you see this error on the command line version of git, you can update it by following these instructions.
If you ran into this error on a git client (such as GitHub Desktop), you may need to update your client as some clients have their own embedded version of git.