ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/Microscope.java
(Generate patch)

Comparing jsr166/src/test/loops/Microscope.java (file contents):
Revision 1.15 by jsr166, Mon Aug 10 03:13:33 2015 UTC vs.
Revision 1.17 by jsr166, Thu Sep 15 06:45:56 2016 UTC

# Line 524 | Line 524 | public class Microscope extends JPanel {
524          }
525  
526          public static boolean inBounds(int row, int col) {
527 <            return (0 <= row)  && (row < RANKS) && (0 <= col) && (col < RANKS);
527 >            return (0 <= row) && (row < RANKS) && (0 <= col) && (col < RANKS);
528          }
529  
530          // The representation
# Line 551 | Line 551 | public class Microscope extends JPanel {
551          long getGreen() { return green_; }
552  
553          public Player occupant(int row, int col) {
554 <            if ((0 <= row)  && (row < RANKS) && (0 <= col) && (col < RANKS)) {
554 >            if ((0 <= row) && (row < RANKS) && (0 <= col) && (col < RANKS)) {
555                  long m = 1L << (row + col * RANKS);
556                  if ((blue_ & m) != 0L) return Player.Blue;
557                  else if ((green_ &m) != 0L) return Player.Green;
# Line 561 | Line 561 | public class Microscope extends JPanel {
561                  return Player.Illegal;
562          }
563  
564 <
565 <        // place a tile without taking opponent tiles
564 >        /** Places a tile without taking opponent tiles. */
565          public void occupy(Player player, int row, int col) {
566              long m = 1L << (row + col * RANKS);
567              long nm = ~m;
# Line 586 | Line 585 | public class Microscope extends JPanel {
585              green_ &= nm;
586          }
587  
588 <        // place a tile, taking all adjacent tiles of opponent
588 >        /** Places a tile, taking all adjacent tiles of opponent. */
589          public void take(Player player, int row, int col) {
590              int k = row + col * RANKS;
591              long dest = 1L << k;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines