Examples of howManyCardsNotNull()


Examples of net.sf.nebulacards.main.PileOfCards.howManyCardsNotNull()

            System.out.println( "Take Lead: " + tl );
        }

        if (wantToWin >= 0)
    {
            if (tl.howManyCardsNotNull() > 0)
      {  // want to win and can
                if (tableau.howManyCardsNotNull() == 3)
                    myPlay = Think.lowCard( tl, true );
                else
                    myPlay = Think.highCard( tl, true );
View Full Code Here

Examples of net.sf.nebulacards.main.PileOfCards.howManyCardsNotNull()

            }
            else  // want to win but can't
                myPlay = Think.lowCard( vp, true );
        }
        else { // don't want to win
            if (tl.howManyCardsNotNull() < vp.howManyCardsNotNull())
      { // don't have to win
                vp.removeAll( tl )// disregard winning cards
                if (pNil || (pWinning && !meNil) ) myPlay = Think.lowCard( vp, true );
                else myPlay = Think.highCard( vp, true );
            }
View Full Code Here

Examples of net.sf.nebulacards.main.PileOfCards.howManyCardsNotNull()

        if (tableau == null || tableau.howManyCardsNotNull() == 0)
      return (float)1.0;
        if (h == null || h.howManyCardsNotNull() == 0)
      return (float)0.0;
        PileOfCards tl = takeLead( h, tableau, position, rules );
        if (tl.howManyCardsNotNull() == 0)
            return 0;
        PileOfCards vp = validPlays( h, tableau, bp, rules );
        float f = 0;
    Enumeration tlCards = tl.elements();
    while (tlCards.hasMoreElements())
View Full Code Here

Examples of net.sf.nebulacards.main.PileOfCards.howManyCardsNotNull()

    Enumeration tlCards = tl.elements();
    while (tlCards.hasMoreElements())
    {
            PlayingCard c = (PlayingCard)tlCards.nextElement();
            if (vp.contains(c))
                f += 2.0 / vp.howManyCardsNotNull();
            else
                f += 1.0;
        }
        float p = f / (float)vp.howManyCardsNotNull();
        p = (float)( p > 1.0 ? 1.0 : p )// make sure we're not above 1.0
View Full Code Here

Examples of net.sf.nebulacards.main.PileOfCards.howManyCardsNotNull()

            if (vp.contains(c))
                f += 2.0 / vp.howManyCardsNotNull();
            else
                f += 1.0;
        }
        float p = f / (float)vp.howManyCardsNotNull();
        p = (float)( p > 1.0 ? 1.0 : p )// make sure we're not above 1.0
        return p;
    }

    /**
 
View Full Code Here

Examples of net.sf.nebulacards.main.Tableau.howManyCardsNotNull()

    public static PileOfCards takeLead( PileOfCards vp, Tableau t,
      int position, Rules rules )
    {
        PileOfCards results = new PileOfCards();
    Tableau tableau = new Tableau( t );
    if (tableau.howManyCardsNotNull() == 0)
      tableau.setLead( position );
    Enumeration cards = vp.elements();
    while (cards.hasMoreElements())
    {
      PlayingCard c = (PlayingCard)cards.nextElement();
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.