Question: Task For this exercise you will write a program that will assess (numerically) who is winning in a game of chess, using the chess piece

Task For this exercise you will write a program that will assess (numerically) who is winning in a game of chess, using the chess piece relative value system. Sample input and output has been provided below: Please type 8 characters for the 8th row of the chessboard: RNBQKBNR Please type 8 characters for the 7th row of the chessboard: PPPPPPPP Please type 8 characters for the 6th row of the chessboard: - Please type 8 characters for the 5th row of the chessboard: - Please type 8 characters for the 4th row of the chessboard: - Please type 8 characters for the 3rd row of the chessboard: -- -- Please type 8 characters for the 2nd row of the chessboard: pppppppp Please type 8 characters for the 1st row of the chessboard : mbqkbnr White has a score of 40 and Black has a score of 40, so this game is a tie Your program must use uppercase letters for the white pieces and lowercase letters for the black pieces. Your program must use the hyphen "" for an empty space and the following abbreviations (K)ing, (Q)ueen, (B)ishop, k(N)ight, (R)ook, and (P)awn. By the chess piece relative value system, kings are not assigned a value, but queens are 10 points each, rooks are 5 points each, knights and bishops are 3 points each, and pawns are 1 point each. Your program must create a dictionary that maps the chess piece abbreviations you read from the string into numerical values and use that dictionary to compute the score. Programs that do not use a dictionary will not be accepted and will receive a mark of zero To achieve a mark of B+ for this exercise, your program must: Create the dictionary, getthe userinput, compute the scores, and comment on who is winning . To achieve a mark of A- or higher for this exercise, your program must also Load chess board from a file Store game score to the chess board file without overriding the content of the file. To manipulate file content, you should use one of the modes discussed in lecture . You should use functions for this exercise. Thus, no code outside functions is allowed exceptfor constants. Moreover, there will be marks for code style such as variables and comments. Task For this exercise you will write a program that will assess (numerically) who is winning in a game of chess, using the chess piece relative value system. Sample input and output has been provided below: Please type 8 characters for the 8th row of the chessboard: RNBQKBNR Please type 8 characters for the 7th row of the chessboard: PPPPPPPP Please type 8 characters for the 6th row of the chessboard: - Please type 8 characters for the 5th row of the chessboard: - Please type 8 characters for the 4th row of the chessboard: - Please type 8 characters for the 3rd row of the chessboard: -- -- Please type 8 characters for the 2nd row of the chessboard: pppppppp Please type 8 characters for the 1st row of the chessboard : mbqkbnr White has a score of 40 and Black has a score of 40, so this game is a tie Your program must use uppercase letters for the white pieces and lowercase letters for the black pieces. Your program must use the hyphen "" for an empty space and the following abbreviations (K)ing, (Q)ueen, (B)ishop, k(N)ight, (R)ook, and (P)awn. By the chess piece relative value system, kings are not assigned a value, but queens are 10 points each, rooks are 5 points each, knights and bishops are 3 points each, and pawns are 1 point each. Your program must create a dictionary that maps the chess piece abbreviations you read from the string into numerical values and use that dictionary to compute the score. Programs that do not use a dictionary will not be accepted and will receive a mark of zero To achieve a mark of B+ for this exercise, your program must: Create the dictionary, getthe userinput, compute the scores, and comment on who is winning . To achieve a mark of A- or higher for this exercise, your program must also Load chess board from a file Store game score to the chess board file without overriding the content of the file. To manipulate file content, you should use one of the modes discussed in lecture . You should use functions for this exercise. Thus, no code outside functions is allowed exceptfor constants. Moreover, there will be marks for code style such as variables and comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
