--- jsr166/src/test/loops/Microscope.java 2010/10/22 05:18:31 1.5 +++ jsr166/src/test/loops/Microscope.java 2011/12/19 19:18:35 1.9 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ import java.awt.*; @@ -242,7 +242,7 @@ public class Microscope extends JPanel { if (lookAheads <= 1) lookAheads = 2; } - public int level () { return Microscope.lookAheads; } + public int level() { return Microscope.lookAheads; } // process a move (called only from mover) @@ -479,7 +479,7 @@ public class Microscope extends JPanel { * threads (instead new ones are constructed), so don't * need any synch. */ - static final class Board { + static final class Board { /* First, some Constants and utilities that might as well be here @@ -606,7 +606,7 @@ public class Microscope extends JPanel { // place a tile, taking all adjacent tiles of opponent public void take(Player player, int row, int col) { - int k = (row + col * RANKS); + int k = row + col * RANKS; long dest = 1L << k; long nbrMask = adjacentMasks[k]; long sourceBlue = blue_; @@ -617,7 +617,7 @@ public class Microscope extends JPanel { } else { blue_ = sourceBlue & ~(sourceBlue & nbrMask); - green_ = sourceGreen | dest | (sourceBlue & nbrMask); + green_ = sourceGreen | dest | (sourceBlue & nbrMask); } } @@ -751,9 +751,9 @@ public class Microscope extends JPanel { // setters: - synchronized void player(Player p) { player_ = p; } - synchronized void board(Board b) { board_ = b; } - synchronized void from(int sr, int sc) { fromRow = sr; fromCol = sc; } + synchronized void player(Player p) { player_ = p; } + synchronized void board(Board b) { board_ = b; } + synchronized void from(int sr, int sc) { fromRow = sr; fromCol = sc; } synchronized void to(int dr, int dc) { toRow = dr; toCol = dc; } // accessors: @@ -761,7 +761,7 @@ public class Microscope extends JPanel { synchronized boolean isFrom(int r, int c) { return fromRow== r && fromCol == c; } - synchronized boolean isTo(int r, int c) { + synchronized boolean isTo(int r, int c) { return toRow == r && toCol == c; } synchronized Board board() {