Remove trailing whitespaces

This commit is contained in:
Matúš Púll 2025-07-26 09:32:04 +02:00
parent 14a0336886
commit c20fcbf873

View file

@ -86,8 +86,8 @@ struct Block {
int x = trg.x, y = trg.y, w = trg.width, h = trg.height;
if(depth == 0) leaf = true;
else
for(int i = 0; i < 9; i++)
sons[i] = new Block(depth-1,
for(int i = 0; i < 9; i++)
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))});
}
int change(tile pl) {
@ -132,7 +132,7 @@ struct Block {
if(d2 != fr) return d2;
bool is_tie = true;
for(Block* s : sons)
for(Block* s : sons)
if(s->t == fr) is_tie = false;
if(is_tie) return tie;
@ -143,7 +143,7 @@ struct Block {
renderImage(t, target);
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);
}
Rectangle getRect(deque<int> v) {
@ -158,11 +158,11 @@ struct Block {
target = trg;
int x = trg.x, y = trg.y, w = trg.width, h = trg.height;
if(leaf) return;
for(int i = 0; i < 9; i++)
for(int i = 0; i < 9; i++)
sons[i]->updateRect({
float(int(x + w/3 * (i%3))),
float(int(y + h/3 * (i/3))),
float(int(w/3)),
float(int(x + w/3 * (i%3))),
float(int(y + h/3 * (i/3))),
float(int(w/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";
for(int play : turn)
outfile << play << std::endl;
for(tile t : state)
for(tile t : state)
outfile << int(t) << std::endl;
}
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++;
turn.erase(turn.begin());
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();
dst = root->getRect(turn);
}