Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. private void revealEmpty(NumericMine mine) {
  2.         ArrayList<NumericMine> tmp = new ArrayList<NumericMine>();
  3.         mineLoop(tmp, mine);
  4.     }
  5.  
  6.     private void mineLoop(ArrayList<NumericMine> tmp, NumericMine mine) {
  7.         ArrayList<NumericMine> links = mine.getLinks();
  8.         if (links != null) {
  9.             for (NumericMine nm : links) {
  10.                 if (!tmp.contains(nm)) {
  11.                     tmp.add(nm);
  12.                     if (nm.getNr() == 0) {
  13.                         mineLoop(tmp, nm);
  14.                     }
  15.                     nm.setActive(false);
  16.                 }
  17.             }
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement