Package org.gnubridge.core

Examples of org.gnubridge.core.Hand


  // this pruning disabled for now
  public void _testOnlyExpandFirstCardInSequenceCardTwoPlayedBetweenTwoUnplayedCards() {
    Node node = new Node(null);
    Deal game = new Deal(NoTrump.i());
    game.getPlayer(Direction.WEST_DEPRECATED).init(new Hand("", "", "4,3,2", ""));
    game.getPlayer(Direction.NORTH_DEPRECATED).init(new Hand("K,10,3", "", "", ""));
    game.getPlayer(Direction.EAST_DEPRECATED).init(new Hand("A,J,2", "", "", ""));
    game.getPlayer(Direction.SOUTH_DEPRECATED).init(new Hand("Q", "3,2", "", ""));
    game.setNextToPlay(Direction.NORTH_DEPRECATED);
    game.play(King.of(Spades.i()));
    game.play(Two.of(Spades.i()));
    game.play(Queen.of(Spades.i()));
    game.play(Two.of(Diamonds.i())); //north takes trick
View Full Code Here


    assertTrue(node.children.get(0).isPlayedSequencePruned());
  }

  public void testWhenPruningPlayedSequenceDoNotConsiderCardsInCurrentTrickAsPlayed() {
    Deal game = new Deal(Spades.i());
    game.getWest().init(new Hand("", "A,Q", "", ""));
    game.getNorth().init(new Hand("", "K,J", "", ""));
    game.getEast().init(new Hand("", "3,2", "", ""));
    game.getSouth().init(new Hand("2", "4", "", ""));
    game.setNextToPlay(Direction.WEST_DEPRECATED);
    SolverConfigurator configurator = new SolverConfigurator();
    configurator.setUseAlphaBetaPruning(false);
    DoubleDummySolver search = new DoubleDummySolver(game, configurator);
    search.setUseDuplicateRemoval(false);
View Full Code Here

  public void testRaiseTo4LevelWith15PointsAnd3TrumpsMinorSuit() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,K,8,7", "K,3,2", "A,J,9", "9,5,4"));
    assertEquals(FOUR_DIAMONDS, rule.getBid());
  }
View Full Code Here

  public void testReallyJumpRaisePartnerWith12To14PointsAnd3Trumps() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(TWO_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,9,8,7", "K,3,2", "A,J,9", "9,5,4"));
    assertEquals(FOUR_DIAMONDS, rule.getBid());
  }
View Full Code Here

  public void testBidUnbidSuitAtTwoLevelWith8PointsAnd5Trumps() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_DIAMONDS);
    a.bid(TWO_HEARTS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,10,9,8,7", "K,3,2", "J,9", "9,5,4"));
    assertEquals(TWO_SPADES, rule.getBid());
  }
View Full Code Here

  public void testBidUnbidSuitAtCheapestLevelWith8PointsAnd5Trumps() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,10,9,8,7", "K,3,2", "J,9", "9,5,4"));
    assertEquals(ONE_SPADES, rule.getBid());
  }
View Full Code Here

  public void testJumpBidUnbidSuitWith12PointsAnd5Trumps() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,10,9,8,7", "K,3,2", "J,9", "A,5,4"));
    assertEquals(TWO_SPADES, rule.getBid());
  }
View Full Code Here

  public void testJumpHigherBidUnbidSuitWith12PointsAnd5Trumps() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(TWO_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,10,9,8,7", "K,3,2", "J,9", "A,5,4"));
    assertEquals(THREE_SPADES, rule.getBid());
  }
View Full Code Here

  public void testBidGameUnbidSuitWith15PointsAnd5Trumps() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,K,9,8,7", "K,3,2", "J,9", "A,5,4"));
    assertEquals(FOUR_SPADES, rule.getBid());
  }
View Full Code Here

  public void testBidNoTrumpOneLevelWith8PointsAndStopperInEnemySuit() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);
    RespondOvercallSuit rule = new RespondOvercallSuit(a, new Hand("A,10,9,8", "9,4,3,2", "J,9", "K,5,4"));
    assertEquals(ONE_NOTRUMP, rule.getBid());
  }
View Full Code Here

TOP

Related Classes of org.gnubridge.core.Hand

Copyright © 2018 www.massapicom. 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.