Package aima.core.util.datastructure

Examples of aima.core.util.datastructure.XYLocation.up()


    XYLocation loc = new XYLocation(3, 3);
    board.addQueenAt(loc);
    Assert.assertEquals(0, board.getNumberOfAttacksOn(loc));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.down().right()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.down().left()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.up().left()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.up().right()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(7, 7)));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 0)));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(6, 0)));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 6)));
View Full Code Here


    board.addQueenAt(loc);
    Assert.assertEquals(0, board.getNumberOfAttacksOn(loc));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.down().right()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.down().left()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.up().left()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(loc.up().right()));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(7, 7)));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 0)));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(6, 0)));
    Assert.assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 6)));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.