void ClockSolver::translate_layout() { /* Read the workspace. */ int total = 0; for ( int w = 0; w < 8; ++w ) { int i = translate_pile(deal->store[w], W[w], 52); Wp[w] = &W[w][i - 1]; Wlen[w] = i; total += i; } /* Output piles, if any. */ for (int i = 0; i < 12; ++i) { KCard *c = deal->target[i]->topCard(); // It is not safe to assume that each target pile will always have a // card on it. If it takes particularly long to render the card graphics // at the start of a new game, it is possible that this method can be // called before the initial deal has been completed. if (c) W[8][i] = translateSuit( c->suit() ) + c->rank(); } Wp[8] = &W[8][11]; Wlen[8] = 12; }
void SimonSolver::translate_layout() { /* Read the workspace. */ int total = 0; for ( int w = 0; w < 10; ++w ) { int i = translate_pile(deal->store[w], W[w], 52); Wp[w] = &W[w][i - 1]; Wlen[w] = i; total += i; } for (int i = 0; i < 4; ++i) { O[i] = -1; KCard *c = deal->target[i]->topCard(); if (c) { total += 13; O[i] = translateSuit( c->suit() ); } } }