Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python3 to solve For this exercise you will write a program that will assess (numerically) who is winning in a game of chess, using

Using python3 to solve

image text in transcribed

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 : rnbqkbnr 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, (QJueen, (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 in 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, get the user input, 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 file Record the history of the game (including both the state of the board and the scores) in the same file data was read from You should use functions for this exercise. Thus, no code outside functions is allowed except for 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions