Skip to content

veraldo/Checkers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Checkers

© 2017 Everaldo

Rules

This implementation is based on the Brazilian Draughts Rules, which includes:
- Backward captures are allowed
- Captures are mandatory
- Promoted pieces can move through any number of squares in a diagonal line
- In case of a sequence of captures, the captured pieces will not be removed until the end of the sequence.
- A piece is only promoted if it stops at a square at the other end of the board, which means that if it
during a capture sequence a piece only passes through it, the piece will not be promoted;

How To Play

The player at the bottom of the board always does the first move.

Left click to select a piece. If it's a piece of the current player, it will be highlighted with a red square.

The possible moves will then be highlighted. Blue squares represents normal moves, and purple squares represents captures.

In case of a capture, you must do the all the follow-up captures, until no captures are possible. The captured pieces will be highlighted, turning blue if it was a light piece, and red if it was a dark piece. At the end of the turn, the highlighted pieces are removed.

If a selected piece does not have any available move even though there's a adjacent empty square in front of it, there's another piece who must do a capture.

You can undo the last move, for as many times as you want, by clicking on the "Undo" label.

◎ = common piece

◉ = promoted piece

Additional info

The board should adapt to the smallest dimension of the screen.
Tested on Chrome 61, Firefox 57, and IE11 but it should work on older versions after IE8 too.

Known issues (to dos)

A capture by a promoted piece is not mandatory until selecting it.
In case of two possible captures, it's not mandatory to make the best move.
In some cases a capturable piece is not detected until the adjacent piece is selected.
When undoing a sequence of captures, some captured pieces may not be restored or highlighted properly.
There's a variable n to define a n x n board, but it does not work properly with a odd n. It's fixed in 8 in the code for now.

About

Programming challenge da Qulture.Rocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published