Write a C++ program with a 8×8 (i.e. 2 dimensional matrix) chessboard and an ite

Write a C++ program with a 8×8 (i.e. 2 dimensional matrix) chessboard and an iterator over that chessboard.
The pieces on the chess board can be a black or white • Rook
• Knight
• Bishop
• Queen • King • Pawn
1.1 The container
The container chessboard should have the methods
• int place(int x, int y, color c, piece p): to place the piece on the chessboard. It should
return
– 1 if successful,
– -1 if illegal x coordinate
1
– -2 if illegal y coordinate
– -3 if square is already occupied – -4 if illegal color
– -5 if illegal piece
• int get(int x, int y, color &c, piece &p): to get the value of the piece on the chessboard.
– 1 if successful,
– -1 if illegal x coordinate
– -2 if illegal y coordinate
– -3 if square is not occupied
1.2 Iterator
The iterator should go through the chessboard in the order [0,0],[1,0],…,[7,0],[0,1],[1,1],…
There should be a method which translates the iterator into x,y coordinates for the chessboard.
• it.xy(int &x, int &y)

Posted in Uncategorized

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount