you should write a C program named infinite_chess.c. This program will accept two inputs from standard in. The first will be one character (used to identify which type of chess piece we are dealing with) and the second will be an integer number, representing the number of moves to simulate. You should get both of these input values using the scanf function. For this program, the only two standard library imports you are allowed to use are and . You may *not* use math.h. As you may already know, a chess board is typically an 8x8 2D grid. However, for this assignment, you should assume we are working with an infinitely large 2D grid / board. The goal of the program is to determine how many possible board locations a particular piece could be at if it started from some location on the board and was able to make at most N moves. You can expect that the first input will be one of three characters: k (for king) b (for brigadier) and p (for pawn). In real chess, pawn movement is a bit more complex, but for our purposes a Pawn can only move 1 location, and can only move in 1 direction (forward). Thus, this is the easiest one to simulate. If the pawn had zero moves, there is only 1 location it could be at. If it had 1 move, it could be in 2 possible places. If it had 2 moves, it could be in 3 possible spots, and so on. When a King moves in chess, it can move to any of the neighboring pieces on the board, including diagonals. For this problem, if the king had zero moves, there is only 1 piece it could be at. However, if it had 1 move, it could be in 9 possible places. If it had 2 moves, it could be in any of 25 possible positions, and so on. The Brigadier is a new chess piece that I made up for this PA. A brigadier can only move to any of its 4 neighboring diagonal locations. It cannot move directly forward / backward / left / right. Thus, if the brigadier had zero moves, there is only 1 piece it could be at. However, if it had 1 move, it could be in 5 possible places. If it had 2 moves, it could be in any of 13 possible positions, and so on. Here are a few examples, with standard input highlighted in red:
$ ./a.out Enter piece type (k, b, p): k Enter number of moves: 5 possible locations: 121 $ ./a.out Enter piece type (k, b, p): p Enter number of moves: 20 possible locations: 21