Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void forest::setOnFire(vector<vector<int>> &vec)
- {
- for (int y = 0, n = 12; y < n; y++){
- for (int x = 0, p = 16; x < p; x++){
- if (vec[y+1][x] == 1)
- {
- vec[y][x] = 1;
- }
- if (vec[y-1][x] == 1)
- {
- vec[y][x] = 1;
- }
- if (vec[y][x+1] == 1)
- {
- vec[y][x] = 1;
- }
- if (vec[y][x-1] == 1)
- {
- vec[y][x] = 1;
- }
- else{
- return;
- }
- }
- }
- }
- QTimer* fireTimer = new QTimer(this);
- connect(fireTimer, SIGNAL(timeout()),this,SLOT(setOnFire()));
- fireTimer->start(1000);
Add Comment
Please, Sign In to add comment