Question: Need this in Codeblocks C programming not C++ There are several knights on a chessboard and you are to determine how many squares they are

Need this in Codeblocks C programming not C++

There are several knights on a chessboard and you are to determine how many squares they are guarding. Write a program that reads positions of knights and prints the number of squares that are guarded by these knights. A square is guarded if it is either occupied by a knight or is reachable by a knight by a single move. A knight move is always by two squares in one direction and by one square in perpendicular direction. E.g. by two squares in horizontal direction and by one square in vertical direction

Example of input:c1e2

Corresponding output: 10

Example of input: c1e2d4c7f7h6

Corresponding output:30

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!