Examples of Square


Examples of com.ir.objects.Square

    // Create a board
    Board board = new Board();
    //Debug.printBoard(board);
   
    // Create the start and end squares
    Square startSquare = board.getSquare(args[0]);
    Square endSquare = board.getSquare(args[1]);
   
    // If the squares contained incorrect positions, print an error statement
    if (startSquare == null || endSquare == null){
      printError(1);
      return;
View Full Code Here

Examples of com.ir.objects.Square

   * @param path - a Path object containing the path from start to finish
   */
  public static void printPath(Path path){
    List<Square> p = path.getPath();
    for (int i = p.size() - 2; i > 0; i--){
      Square s = p.get(i);
      System.out.print(s.toString() + " ");
    }
    Square s = p.get(0);
    System.out.println(s.toString());
  }
View Full Code Here

Examples of com.ir.objects.Square

   
    // While we still have nodes to explore
    while (!openSet.isEmpty()){
      // Get the node with the lowest f-score from the priority queue
      Node current = openSet.poll();
      Square currentSquare = current.getSquare();
     
      // If we've found the goal, return the path we took to get there
      if (currentSquare.equals(end))
        return reconstructPath(currentSquare);

      // Add current to closedset, and move the chess piece to that square
      closedSet.add(currentSquare);
      chessPiece.move(currentSquare);
View Full Code Here

Examples of com.ir.objects.Square

   * @param currentSquare - the square the chess piece is currently on
   * @return the path to the current square
   */
  public Path reconstructPath(Square currentSquare){
    path.addSquare(currentSquare);
    Square c = null;
    while ((c = cameFrom.get(currentSquare)) != null){
      path.addSquare(c);
      currentSquare = c;
    }
    return path;
View Full Code Here

Examples of com.kjoshi.shareit.responsible.Square

  public static void main(String[] args) {
    // I am keeping Circle in the last in the chain so starting from Circle
    Area circle = new Circle();
    Area triangle = new Triangle(circle);
    Area rectangle = new Rectangle(triangle);
    Area square = new Square(rectangle);
    for (String shape : listOfShapes()) {
      square.findArea(shape);
    }
  }
View Full Code Here

Examples of com.luxoft.dnepr.courses.unit2.model.Square

    @Test
    public void calculateOverallAreaTest() {
        List<Figure> figures = new ArrayList<Figure>();
        figures.add(new Circle(2d));
        figures.add(new Square(3d));
        figures.add(new Hexagon(4d));
        final double SUM_OF_SQUARES = 63.1355899d;
        Assert.assertEquals(SUM_OF_SQUARES, LuxoftUtils.calculateOverallArea(figures), DELTA);
    }
View Full Code Here

Examples of com.luxoft.dnepr.courses.unit2.model.Square

    @Test
    public void testCalculateOverallArea() {
        ArrayList<Figure> list1 = new ArrayList<Figure>();
        list1.add(new Circle(1));
        list1.add(new Square(2));
        list1.add(new Hexagon(3));
        double overallArea1 = Math.PI + 4 + (3 * Math.sqrt(3) / 2) * 9;
        assertEquals(overallArea1, LuxoftUtils.calculateOverallArea(list1), delta);

        ArrayList<Figure> list2 = new ArrayList<Figure>();
        list1.add(new Square(5));
        list1.add(new Hexagon(7));
        list1.add(new Circle(9));
        list1.add(new Square(8));
        double overallArea2 = Math.PI * 25 (3 * Math.sqrt(3) / 2) * 49 + Math.PI * 81 + 64;
    }
View Full Code Here

Examples of com.luxoft.dnepr.courses.unit2.model.Square

        double overallArea2 = Math.PI * 4 + (3 * Math.sqrt(3) / 2) * 9;
        assertEquals(overallArea2, LuxoftUtils.calculateOverallArea(list2), delta);

        ArrayList<Figure> list3 = new ArrayList<Figure>();
        list3.add(new Circle(0));
        list3.add(new Square(0));
        list3.add(new Hexagon(0));
        assertEquals(0.00, LuxoftUtils.calculateOverallArea(list3), delta);
    }
View Full Code Here

Examples of gnu.javax.crypto.cipher.Square

    }

  public void test(TestHarness harness)
  {
    harness.checkPoint("TestOfSquare");
    cipher = new Square();
    HashMap attrib = new HashMap();
    attrib.put(IBlockCipher.CIPHER_BLOCK_SIZE, new Integer(16));
    attrib.put(IBlockCipher.KEY_MATERIAL, new byte[16]);
    try
      {
View Full Code Here

Examples of labyrinth.grid.Square

   */
  public void drawVisitedRooms(Graphics g) {
    /*
     * Drawing known rooms
     */
    Square c = (Square) bob.getLocation();
    if (!visitedRooms.contains(c)) // updating visited rooms
      visitedRooms.add(c);
    for (Square s : visitedRooms) {
      int j = s.getColumn();
      int i = s.getRow();
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.