lazarchitect / FlaskReactor

With a Flask backend and a React front-end, this site will let you play board games online with friends. The culmination of many different ideas and projects. Full stack, complete with PostgreSQL database and CI/CD Jenkins + Docker tooling. Powered by Linux / Raspberry Pi!
http://flaskreactor.net
1 stars 0 forks source link

Component logic: Seeing if the last chess game turn involved a pawn leaping, and where #79

Open lazarchitect opened 2 months ago

lazarchitect commented 2 months ago

Important piece of info for evaluating en passant during opposing pawn's valid move generation.

Dependent on #77 being completed first.

See notebook entry 5.5

lazarchitect commented 14 hours ago

basically: if the previous game turn, i.e. your opponent's most recent turn, involved a pawn leaping (simple boolean), then when we go to move our pawn, we can check if the pawn is next to the column where the enemy pawn leapt, and we also need to be in the same row as that pawn (row 3 for black and row 4 for white or whatever). So both pieces of data need to be tracked.

How to track it? Well, each turn, we can mark "pawnLeapt" as true or false, and "pawnLeapCol" as 1 through 8, or -1 if no pawn leaped. it's important that this piece of data gets overwritten every turn to be as up to date as possible.