I am writing a simple game in which datasets are stored in a 2D grid (for example, a chessboard). Each cell in the grid can contain one integer (0 means that the cell is empty). If the cell contains a number> 0, it is called "filled." A set of “filled” cells on a grid is known as a “configuration”.
My problem is the ability to “recognize” a particular configuration, regardless of where the cell configuration is in the MxN grid.
The problem (in my opinion) is divided into the following two problems:
It somehow “normalizes” the position of the configuration (for example, “rearranging” its position by (0,0), so that the smallest rectangle containing all the cells in the configuration has its left vertex at (0,0) in the MxN grid
Calculation of some similarity metric (or maybe just a given difference?) To determine if the current “normalized” configuration is one of the known configurations (ie, “recognized”)
I suspect that I will need to use std :: set (one of the few STL containers that I have not used so far, for all my years, as a C ++ encoder!). I would appreciate any ideas / advice from those who have solved this problem before. Any pieces of code, pseudo-codes and / or links will be very useful.