Esempio n. 1
0
 public Collection<XY> neighbors() {
   Collection<XY> neighbors = new ArrayList<XY>(4);
   for (int i : new int[] {-1, 0, 1}) {
     for (int j : new int[] {-1, 0, 1}) {
       if (i == 0 ^ j == 0) {
         XY neighbor = XY.at(x + i, y + j);
         if (neighbor != null) neighbors.add(neighbor);
       }
     }
   }
   return neighbors;
 }
Esempio n. 2
0
 public void set(int x, int y, ScribeMark mark) {
   set(XY.at(x, y), mark);
 }