   Grid pattern finding slgorithm
  I have a grid of numbers representing objects in a game.I want to find particular patterns (if they occur) and act on them accordingly. For instance if the numbers form certain shapes (Tetris-like shapes) then something will happen.Can some give me the name of an algorithm or point me to a site. Perhaps a few starting ideas would help.ThanksThomo.   
  Are you sure a brute-force algorithm (checking every possible shape against every grid position) isn't sufficient for what you want to do?;  Yes....was thinking along those, but thought they might be a cleaner way.   ;  Pseudo-C++ pseudocode:int array[X][Y];struct part {  int value;   coord coord_offset; // this is really an offset};typedef std::vector<part> symbol;std::vector<symbol> symbols;symbol s;// A L with is made of 1://    1//    1//    1//    111s.push_back(part(1, (0,0));s.push_back(part(1, (0,1));s.push_back(part(1, (0,2));s.push_back(part(1, (0,3));s.push_back(part(1, (0,4));s.push_back(part(1, (1,4));s.push_back(part(1, (2,4));symbols.push_back(s);for each symbol in symbols {  // the find goes from (0,0) to (X-1,0) to (X-1,Y-1)  while array has not been processed entirely {    (x,y) = find next symbol[0].value in array    symbol_found = true;    for each part i in symbol { part_coord = (x,y) + symbol.coord_offset if (array(part_coord) != symbol.value) {   symbol_found = false;   break; }    }  }}The idea is very similar to a basic string search (first, search the first carh of the string, if it is found then verify if the subsequent chars are ok) adapted to 2D.I'm rather obscure, but I hope you get it [smile]   