Remove trailing whitespaces
This commit is contained in:
parent
14a0336886
commit
c20fcbf873
1 changed files with 10 additions and 10 deletions
|
@ -86,8 +86,8 @@ struct Block {
|
||||||
int x = trg.x, y = trg.y, w = trg.width, h = trg.height;
|
int x = trg.x, y = trg.y, w = trg.width, h = trg.height;
|
||||||
if(depth == 0) leaf = true;
|
if(depth == 0) leaf = true;
|
||||||
else
|
else
|
||||||
for(int i = 0; i < 9; i++)
|
for(int i = 0; i < 9; i++)
|
||||||
sons[i] = new Block(depth-1,
|
sons[i] = new Block(depth-1,
|
||||||
{float(int(x + w/3 * (i%3))), float(int(y + h/3 * (i/3))), float(int(w/3)), float(int(h/3))});
|
{float(int(x + w/3 * (i%3))), float(int(y + h/3 * (i/3))), float(int(w/3)), float(int(h/3))});
|
||||||
}
|
}
|
||||||
int change(tile pl) {
|
int change(tile pl) {
|
||||||
|
@ -132,7 +132,7 @@ struct Block {
|
||||||
if(d2 != fr) return d2;
|
if(d2 != fr) return d2;
|
||||||
|
|
||||||
bool is_tie = true;
|
bool is_tie = true;
|
||||||
for(Block* s : sons)
|
for(Block* s : sons)
|
||||||
if(s->t == fr) is_tie = false;
|
if(s->t == fr) is_tie = false;
|
||||||
if(is_tie) return tie;
|
if(is_tie) return tie;
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ struct Block {
|
||||||
renderImage(t, target);
|
renderImage(t, target);
|
||||||
if(leaf || (t != fr && t != tie)) return;
|
if(leaf || (t != fr && t != tie)) return;
|
||||||
|
|
||||||
for(int i = 0; i < 9; i++)
|
for(int i = 0; i < 9; i++)
|
||||||
sons[i]->render(depth-1);
|
sons[i]->render(depth-1);
|
||||||
}
|
}
|
||||||
Rectangle getRect(deque<int> v) {
|
Rectangle getRect(deque<int> v) {
|
||||||
|
@ -158,11 +158,11 @@ struct Block {
|
||||||
target = trg;
|
target = trg;
|
||||||
int x = trg.x, y = trg.y, w = trg.width, h = trg.height;
|
int x = trg.x, y = trg.y, w = trg.width, h = trg.height;
|
||||||
if(leaf) return;
|
if(leaf) return;
|
||||||
for(int i = 0; i < 9; i++)
|
for(int i = 0; i < 9; i++)
|
||||||
sons[i]->updateRect({
|
sons[i]->updateRect({
|
||||||
float(int(x + w/3 * (i%3))),
|
float(int(x + w/3 * (i%3))),
|
||||||
float(int(y + h/3 * (i/3))),
|
float(int(y + h/3 * (i/3))),
|
||||||
float(int(w/3)),
|
float(int(w/3)),
|
||||||
float(int(h/3))
|
float(int(h/3))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ void save_state(Block* root, int depth, int time, deque<int> &turn) {
|
||||||
outfile << depth << "\n" << time << "\n" << turn.size() << "\n";
|
outfile << depth << "\n" << time << "\n" << turn.size() << "\n";
|
||||||
for(int play : turn)
|
for(int play : turn)
|
||||||
outfile << play << std::endl;
|
outfile << play << std::endl;
|
||||||
for(tile t : state)
|
for(tile t : state)
|
||||||
outfile << int(t) << std::endl;
|
outfile << int(t) << std::endl;
|
||||||
}
|
}
|
||||||
void load_state(Block** root, deque<int> &turn, int &depth, int &time, char* argv) {
|
void load_state(Block** root, deque<int> &turn, int &depth, int &time, char* argv) {
|
||||||
|
@ -227,7 +227,7 @@ void update(int &time, deque<int> &turn, Block* root, Rectangle &dst) {
|
||||||
time++;
|
time++;
|
||||||
turn.erase(turn.begin());
|
turn.erase(turn.begin());
|
||||||
int rval_2 = root->play(turn, pas(time));
|
int rval_2 = root->play(turn, pas(time));
|
||||||
for(int i = 0; i <= rval_2; i++)
|
for(int i = 0; i <= rval_2; i++)
|
||||||
turn.pop_back();
|
turn.pop_back();
|
||||||
dst = root->getRect(turn);
|
dst = root->getRect(turn);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue