Colored coin game is a 8X8 board game which has many colored coins. Each coin has a weight and power. Power of a coin is defined by the moves that it can make. In a move, a black coin can move one step vertically upwards. A red coin can move one step either horizontally, vertically or diagonally. Given the current position of a black coin and list of movements made by it, print all possible next positions of the coin. If the total number of moves made by a black coin is greater than 6, then that coin should be treated as a red coin and the subsequent moves will be as that of the red coin. At any point of time, the coin cannot move outside the board. The rows and columns of the board are numbered as 1 to 8. Print the horizontal movement of coin in an increasing order of columns and print the vertical movement of coin in increasing order of rows. To print, the diagonal movement of the coin refer the sample board config given below. If the current position of your coin is 4,4 then print P1, P2 … P8 in order..
C++ CODE
0 Comments