(whereAmI+1) % 4, beenPlayed, rules ) < 0.35
) wantToWin -= 6;
break;
}
PileOfCards vp = Think.validPlays( hand, tableau, beenPlayed, rules );
PileOfCards tl = Think.takeLead( vp, tableau, whereAmI, rules );
if (verbose) {
System.out.print( "Want to Win: " ); System.out.println( wantToWin );
System.out.println( "Tableau: " + tableau );
System.out.println( "Hand: " + hand );
System.out.println( "Valid Plays: " + vp );
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 );
}
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 );
}