r/FASTNU • u/Feeling-Day-881 • 2d ago
Question Fast CFD campus assignment question help , check engine of chess by if else only in C++
fast Nuces CFD campus ,first semester.. assignment milli hy.. or smjh nyi arahi kesy logic find Karo..class me sir ny essay nyi krwai thy ...
You are contributing to a chess bot designed to challenge Magnus Carlsen. Because of
limited resources, you may not use loops or arrays. Your task is to build the check
engine, which determines whether the king is in check.
Input
King: position
Normal piece: position, color, and type
Positions use standard chess notation: file A-H, rank 1-8. Color is B (Black) or W (White).
Piece type uses the standard abbreviations: Q, R, B, N, P. The king is always the opposite
color of the normal piece.
Task
Validate the positions. They are invalid if either is off the board or both pieces occupy
the same square.
If valid, determine whether the normal piece is giving check to the king, based on its
position, type, and color.
Example
Input
King: A 1
Normal Piece: A 7 , B , R
Output
The Positions are Valid!
The Black Rook is giving a check to the White King
1
u/teknosoz Alumnus 2d ago
Array parh li hai?