Skip to content

12. Castling and En passant

phu54321 edited this page Jan 24, 2018 · 9 revisions

The material used in this chapter can be downloaded at here.

We introduced a concept of objects in the last chapter. In this chapter, we implement castling and en passant on this chapter.

Castling En passant

Updating LMTN (Last moved turn number)

On chapter 11 we created lastMovedTurn member, but we haven't yet used it. Currently this field is initialized to 0, but isn't updated thereafter. To use this field, we first have to put a correct number to lastMovedTurn member.