Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- För varje ruta som är 0
- area++;
- std::vector<int> rutor;
- Lägg till rutan i rutor
- Är Rutor tom? JA = Gå upp till rad 1
- Är Rutor tom? Nej
- int curRuta = rutor.size();
- rutor.pop_back;
- sätt currutas ruta till area
- Är rutan OVANför = 0 Lägg i rutor
- Är rutan vänster = 0 Lägg i rutor
- Är rutan under = 0 Lägg i rutor
- Är rutan till höger = 0 lätt i rutor
- ##kod
- do {
- for (size_t ix = 0; ix != array_size; ++ix)
- {
- if (box[ix] == 0)
- {
- area++;
- rutor.push_back(box[ix]);
- }
- }
- } while (!rutor.size());
- while (rutor.size()) {
- int curRuta = rutor.size();
- rutor.pop_back();
- curRuta = area;
- if ((curRuta-200) == 0)
- {
- rutor.push_back(curRuta);
- }
- else if ((curRuta-1) == 0)
- {
- rutor.push_back(curRuta);
- }
- else if ((curRuta+200) == 0)
- {
- rutor.push_back(curRuta);
- }
- else if ((curRuta+1) == 0)
- {
- rutor.push_back(curRuta);
- }
- }
Add Comment
Please, Sign In to add comment