| 513 | int GIB_TO_DDS[4] = {1, 0, 3, 2}; |
| 514 | |
| 515 | bool parse_GIB( |
| 516 | const string& line, |
| 517 | DealPBN * dl, |
| 518 | DdTableResults * table) |
| 519 | { |
| 520 | string st = "W:" + line.substr(0, 67); |
| 521 | strcpy(dl->remainCards, st.c_str()); |
| 522 | |
| 523 | int dds_strain, dds_hand; |
| 524 | for (int s = 0; s < DDS_STRAINS; s++) |
| 525 | { |
| 526 | dds_strain = (s == 0 ? 4 : s - 1); |
| 527 | for (unsigned h = 0; h < DDS_HANDS; h++) |
| 528 | { |
| 529 | dds_hand = GIB_TO_DDS[h]; |
| 530 | char const c = (line.substr( |
| 531 | 68 + 4*static_cast<unsigned>(s) + h, 1).c_str())[0]; |
| 532 | int d; |
| 533 | if (c >= 48 && c <= 57) // 0, 9 |
| 534 | d = c-48; |
| 535 | else if (c >= 65 && c <= 70) // A, F |
| 536 | d = c-55; |
| 537 | else |
| 538 | return false; |
| 539 | |
| 540 | if (dds_hand & 1) |
| 541 | d = 13 - d; |
| 542 | |
| 543 | table->res_table[dds_strain][dds_hand] = d; |
| 544 | } |
| 545 | } |
| 546 | return true; |
| 547 | } |
| 548 | |
| 549 | |
| 550 | bool get_any_line( |