Let’s play RIT: https://github.com/ogrnv/random-intelligence-tests There is only one…
- User
Let’s play RIT: https://github.com/ogrnv/random-intelligence-tests
There is only one player in the game - you, so you should take the first move!
Let TB be given board with chips or the board with chips after your move(s), TB[address] be an integer assigned to a cell with the address: zero mean an empty cell, non-zero mean a chip marked with the integer on the cell.
Let EM be a relocation of a chip to a horizontally or vertically adjacent zero cell. As a result of this relocation, the values of TB[from] and TB[to] should swap.
Every game move must be either an EM or a sequence of several EMs. Let the move start address be SA and the move finish address be FA. Please note: FA must not be equal to SA. Let move number be MN.
The goal of the game is to complete it in the fewest number of moves. The game ends after 2 step(s). A step ends when YOU by your last move, complete a formation of a straight horizontal or vertical or diagonal line of five or more chips with the same marking. After completing the step, you will receive and must use TB board with these updates: five successive chips are removed from the line (for cases with long or/and several line(s) it done randomly), then five previously presented chips are randomly added to the free cells of the board.
For the sake of certainty, let in an cell address [i,j], i be the row number, j be the column number and both be numbered from zero.
The board with chips is:
0,0,1,2,0,2,1,2 0,0,2,1,2,1,2,2 2,1,0,2,1,1,1,1 2,1,1,2,1,2,2,1 1,2,2,2,0,2,2,2 1,1,1,2,2,0,2,2 2,1,1,2,2,1,2,2 1,2,1,2,1,0,2,0
The next five chips: 2,2,1,2,2
Please, disable any output other than printing the MN, SA, FA and the board after each move. Wait my input after each move (also after your adjustments,if any). It could be: a status line indicating the number of moves and steps; ok - go to the next move; b ??? - wrong, decrease MN by 1 and come back; s - a step completed. An updated board with chips and five new random chips will be provided; F - the game is over. where ??? is a reason of the error.
- Assistantcode
MN: 1 SA: [0,2] FA: [0,1] 0,1,0,2,0,2,1,2 0,0,2,1,2,1,2,2 2,1,0,2,1,1,1,1 2,1,1,2,1,2,2,1 1,2,2,2,0,2,2,2 1,1,1,2,2,0,2,2 2,1,1,2,2,1,2,2 1,2,1,2,1,0,2,0