Language: C++

#include <vector>
#include <algorithm>
using namespace std;

int parse(const vector<string>& subgrid)
{
  unsigned s = 0;
  s |= ((subgrid[1][3] == '-') << 6);
  s |= ((subgrid[2][2] == '|') << 5);
  s |= ((subgrid[2][4] == '|') << 4);
  s |= ((subgrid[3][3] == '-') << 3);
  s |= ((subgrid[4][2] == '|') << 2);
  s |= ((subgrid[4][4] == '|') << 1);
  s |= ((subgrid[5][3] == '-') << 0);
  switch (s) {
    case 19:  return 1;
    case 93:  return 2;
    case 91:  return 3;
    case 58:  return 4;
    case 107: return 5;
    case 111: return 6;
    case 82:  return 7;
    case 127: return 8;
    case 123: return 9;
    default:  throw "unrecognized char";
  }
}

void lr(vector<string>& subgrid)
{
  for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
    reverse(it->begin(), it->end());
  }
}

void ud(vector<string>& subgrid)
{
  reverse(subgrid.begin(), subgrid.end());
}

void rot(vector<string>& subgrid)
{
  const vector<string> src(subgrid);
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < 7; j++) {
      if (src[i][j] == '|') {
        subgrid[6-j][i] = '-';
      } else if (src[i][j] == '-') {
        subgrid[6-j][i] = '|';
      } else {
        subgrid[6-j][i] = src[i][j];
      }
    }
  }
}

int main()
{
  string line;
  while (cin >> line && line != "0") {
    vector<string> lines(1, line);
    for (int i = 1; i < 21; i++) {
      cin >> line;
      lines.push_back(line);
    }
    int d[2][6];
    for (int k = 0; k < 2; k++) {
      static const int tbl[][2] = {{0,7},{7,0},{7,7},{7,14},{7,21},{14,7}};
      for (int i = 0; i < 6; i++) {
        vector<string> grid;
        for (int j = 0; j < 7; j++) {
          grid.push_back(lines[tbl[i][0]+j].substr(tbl[i][1]+29*k, 7));
        }
        switch (i) {
          case 0:
          case 2:
          case 4:
            lr(grid);
            break;
          case 1:
            rot(grid);
            rot(grid);
            rot(grid);
            lr(grid);
            break;
          case 3:
            rot(grid);
            lr(grid);
            break;
          case 5:
            lr(grid);
            ud(grid);
            break;
        }
        d[k][i] = parse(grid);
      }
    }
    int w[2] = {0, 0};
    for (int i = 0; i < 6; i++) {
      for (int j = 0; j < 6; j++) {
        if (d[0][i] > d[1][j]) {
          ++w[0];
        } else if (d[0][i] < d[1][j]) {
          ++w[1];
        }
      }
    }
    cout << (w[0] < w[1] ? "LOW" : "HIGH") << endl;
  }
  return 0;
}

Compiler output:
a.cc:5:24: error: 'string' was not declared in this scope
    5 | int parse(const vector<string>& subgrid)
      |                        ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <algorithm>
  +++ |+#include <string>
    3 | using namespace std;
a.cc:5:30: error: template argument 1 is invalid
    5 | int parse(const vector<string>& subgrid)
      |                              ^
a.cc:5:30: error: template argument 2 is invalid
a.cc: In function 'int parse(const int&)':
a.cc:8:17: error: invalid types 'const int[int]' for array subscript
    8 |   s |= ((subgrid[1][3] == '-') << 6);
      |                 ^
a.cc:9:17: error: invalid types 'const int[int]' for array subscript
    9 |   s |= ((subgrid[2][2] == '|') << 5);
      |                 ^
a.cc:10:17: error: invalid types 'const int[int]' for array subscript
   10 |   s |= ((subgrid[2][4] == '|') << 4);
      |                 ^
a.cc:11:17: error: invalid types 'const int[int]' for array subscript
   11 |   s |= ((subgrid[3][3] == '-') << 3);
      |                 ^
a.cc:12:17: error: invalid types 'const int[int]' for array subscript
   12 |   s |= ((subgrid[4][2] == '|') << 2);
      |                 ^
a.cc:13:17: error: invalid types 'const int[int]' for array subscript
   13 |   s |= ((subgrid[4][4] == '|') << 1);
      |                 ^
a.cc:14:17: error: invalid types 'const int[int]' for array subscript
   14 |   s |= ((subgrid[5][3] == '-') << 0);
      |                 ^
a.cc: At global scope:
a.cc:29:16: error: 'string' was not declared in this scope
   29 | void lr(vector<string>& subgrid)
      |                ^~~~~~
a.cc:29:16: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:29:22: error: template argument 1 is invalid
   29 | void lr(vector<string>& subgrid)
      |                      ^
a.cc:29:22: error: template argument 2 is invalid
a.cc: In function 'void lr(int&)':
a.cc:31:15: error: 'string' was not declared in this scope
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |               ^~~~~~
a.cc:31:15: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:31:21: error: template argument 1 is invalid
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |                     ^
a.cc:31:21: error: template argument 2 is invalid
a.cc:31:32: error: expected ';' before 'it'
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |                                ^~~
      |                                ;
a.cc:31:33: error: 'it' was not declared in this scope; did you mean 'int'?
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |                                 ^~
      |                                 int
a.cc:31:46: error: request for member 'begin' in 'subgrid', which is of non-class type 'int'
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |                                              ^~~~~
a.cc:31:69: error: request for member 'end' in 'subgrid', which is of non-class type 'int'
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |                                                                     ^~~
a.cc:31:74: error: expected ')' before ';' token
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |       ~                                                                  ^
      |                                                                          )
a.cc:31:78: error: 'it' was not declared in this scope; did you mean 'int'?
   31 |   for (vector<string>::iterator it = subgrid.begin(); it != subgrid.end(); ++it) {
      |                                                                              ^~
      |                                                                              int
a.cc: At global scope:
a.cc:36:16: error: 'string' was not declared in this scope
   36 | void ud(vector<string>& subgrid)
      |                ^~~~~~
a.cc:36:16: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:36:22: error: template argument 1 is invalid
   36 | void ud(vector<string>& subgrid)
      |                      ^
a.cc:36:22: error: template argument 2 is invalid
a.cc: In function 'void ud(int&)':
a.cc:38:19: error: request for member 'begin' in 'subgrid', which is of non-class type 'int'
   38 |   reverse(subgrid.begin(), subgrid.end());
      |                   ^~~~~
a.cc:38:36: error: request for member 'end' in 'subgrid', which is of non-class type 'int'
   38 |   reverse(subgrid.begin(), subgrid.end());
      |                                    ^~~
a.cc: At global scope:
a.cc:41:17: error: 'string' was not declared in this scope
   41 | void rot(vector<string>& subgrid)
      |                 ^~~~~~
a.cc:41:17: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:41:23: error: template argument 1 is invalid
   41 | void rot(vector<string>& subgrid)
      |                       ^
a.cc:41:23: error: template argument 2 is invalid
a.cc: In function 'void rot(int&)':
a.cc:43:16: error: 'string' was not declared in this scope
   43 |   const vector<string> src(subgrid);
      |                ^~~~~~
a.cc:43:16: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:43:22: error: template argument 1 is invalid
   43 |   const vector<string> src(subgrid);
      |                      ^
a.cc:43:22: error: template argument 2 is invalid
a.cc:46:14: error: invalid types 'const int[int]' for array subscript
   46 |       if (src[i][j] == '|') {
      |              ^
a.cc:47:16: error: invalid types 'int[int]' for array subscript
   47 |         subgrid[6-j][i] = '-';
      |                ^
a.cc:48:21: error: invalid types 'const int[int]' for array subscript
   48 |       } else if (src[i][j] == '-') {
      |                     ^
a.cc:49:16: error: invalid types 'int[int]' for array subscript
   49 |         subgrid[6-j][i] = '|';
      |                ^
a.cc:51:16: error: invalid types 'int[int]' for array subscript
   51 |         subgrid[6-j][i] = src[i][j];
      |                ^
a.cc:51:30: error: invalid types 'const int[int]' for array subscript
   51 |         subgrid[6-j][i] = src[i][j];
      |                              ^
a.cc: In function 'int main()':
a.cc:59:3: error: 'string' was not declared in this scope
   59 |   string line;
      |   ^~~~~~
a.cc:59:3: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:60:10: error: 'cin' was not declared in this scope
   60 |   while (cin >> line && line != "0") {
      |          ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:60:17: error: 'line' was not declared in this scope
   60 |   while (cin >> line && line != "0") {
      |                 ^~~~
a.cc:61:18: error: template argument 2 is invalid
   61 |     vector<string> lines(1, line);
      |                  ^
a.cc:61:33: error: expression list treated as compound expression in initializer [-fpermissive]
   61 |     vector<string> lines(1, line);
      |                                 ^
a.cc:64:13: error: request for member 'push_back' in 'lines', which is of non-class type 'int'
   64 |       lines.push_back(line);
      |             ^~~~~~~~~
a.cc:70:22: error: template argument 2 is invalid
   70 |         vector<string> grid;
      |                      ^
a.cc:72:16: error: request for member 'push_back' in 'grid', which is of non-class type 'int'
   72 |           grid.push_back(lines[tbl[i][0]+j].substr(tbl[i][1]+29*k, 7));
      |                ^~~~~~~~~
a.cc:72:31: error: invalid types 'int[int]' for array subscript
   72 |           grid.push_back(lines[tbl[i][0]+j].substr(tbl[i][1]+29*k, 7));
      |                               ^
a.cc:108:5: error: 'cout' was not declared in this scope
  108 |     cout << (w[0] < w[1] ? "LOW" : "HIGH") << endl;
      |     ^~~~
a.cc:108:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:108:47: error: 'endl' was not declared in this scope
  108 |     cout << (w[0] < w[1] ? "LOW" : "HIGH") << endl;
      |                                               ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;