Guest User

Untitled

a guest
May 26th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. För varje ruta som är 0
  2. area++;
  3. std::vector<int> rutor;
  4. Lägg till rutan i rutor
  5.  
  6. Är Rutor tom? JA = Gå upp till rad 1
  7.  
  8. Är Rutor tom? Nej
  9. int curRuta = rutor.size();
  10. rutor.pop_back;
  11.  
  12. sätt currutas ruta till area
  13.  
  14. Är rutan OVANför = 0 Lägg i rutor
  15. Är rutan vänster = 0 Lägg i rutor
  16. Är rutan under = 0 Lägg i rutor
  17. Är rutan till höger = 0 lätt i rutor
  18.  
  19. ##kod
  20.  
  21. do {
  22. for (size_t ix = 0; ix != array_size; ++ix)
  23. {
  24. if (box[ix] == 0)
  25. {
  26. area++;
  27. rutor.push_back(box[ix]);
  28. }
  29. }
  30. } while (!rutor.size());
  31.  
  32. while (rutor.size()) {
  33. int curRuta = rutor.size();
  34. rutor.pop_back();
  35.  
  36. curRuta = area;
  37.  
  38. if ((curRuta-200) == 0)
  39. {
  40. rutor.push_back(curRuta);
  41. }
  42. else if ((curRuta-1) == 0)
  43. {
  44. rutor.push_back(curRuta);
  45. }
  46. else if ((curRuta+200) == 0)
  47. {
  48. rutor.push_back(curRuta);
  49. }
  50. else if ((curRuta+1) == 0)
  51. {
  52. rutor.push_back(curRuta);
  53. }
  54. }
Add Comment
Please, Sign In to add comment