** * Write a description of class Board here. * * @Saad Khalid * @version (a version number or a...
-
Upload
abraham-malone -
Category
Documents
-
view
212 -
download
0
Transcript of ** * Write a description of class Board here. * * @Saad Khalid * @version (a version number or a...
/** * Write a description of class Board here. * * @Saad Khalid * @version (a version number or a date) */
/** * @author Pawel Durakiewicz * @version 10/19/12 */
1
/** * Create a Board. * * @author Anna Cowan * @version 20-26-12 */
/** * Create a Deck of 52 cards. * * @author Anna Cowan * @version 11-13-12 */
/** * Write a description of class Board here. * * @author Patrick Cowan * @version 10/28/12 */
/** * Creates a Board * * @Alex Ververis * @10/28/2012 */
2
/** * Boards * * @James Dai * @10/29/12 */
/** * FiveCardHand * * @Mayhugh, Alex * @11/2/20 */
3
/** * * Do Jin * 10-31-12 */
/************************************************************** Class name: Board.java* Author: Artyom Pavlichenko* Date: 08/31:Friday/2012*************************************************************/
4
public void sortHand(){ int final HAND_SIZE = 5 ;
Card temp ; for(int i=0 ; i<5 ; i++) { for(int j=1+i ; j<5 ; j++) { if( hand.get(i).getVal() > hand.get(j).getVal()) { statements .........
}//end if }//end for }//end for}//end sor
5
//javaDoc could take care of the 5 and 6//Style?????public int findQuadrantA() { if (xCoord < 0 & yCoord > 0) {return 1;} else if (xCoord > 0 && yCoord > 0) {return 2;} else if (xCoord < 0 && yCoord < 0) {return 3;} else if (xCoord > 0 && yCoord < 0) {return 4;} else if (xCord == 0 && yCoord == 0) {return 0;} else if (xCoord == 0 && yCoord !=0) {return 5;} else {return 6;} }
6
public int findQuadrantA() { if (xCoord < 0 & yCoord > 0) return 1; else if (xCoord > 0 && yCoord > 0) return 2; else if (xCoord < 0 && yCoord < 0) return 3; else if (xCoord > 0 && yCoord < 0) return 4;
else if (xCord == 0 && yCoord == 0) return 0;
else if (xCoord == 0 && yCoord !=0) return 5;
else return 6; }//end method
//javaDoc could take care of the 5 and 6//Style?????public int findQuadrantA() { if (xCoord < 0 & yCoord > 0) {return 1;} else if (xCoord > 0 && yCoord > 0) {return 2;} else if (xCoord < 0 && yCoord < 0) {return 3;} else if (xCoord > 0 && yCoord < 0) {return 4;} else if (xCord == 0 && yCoord == 0) {return 0;} else if (xCoord == 0 && yCoord !=0) {return 5;} else {return 6;} }
public void shuffle() { Random rnd= new Random(7); ArrayList firstPile= new ArrayLis(); for (int i= 0; i< rnd.nextInt(11)+ 20; i++) { firstPile.add(deck.get(i)); }//end for ArrayList secondPile= new ArrayList(); for (int i= firstPile.size(); i< deck.size(); i++) { secondPile.add(deck.get(i)); }//end for int k= 51; //k will be the index of the deck array while (firstPile.size()!= 0 && secondPile.size()!= 0) { int putDown= rnd.nextInt(4)+ 1; if (putDown> firstPile.size())
public double getDistanceFromOrigin() { return Math.sqrt( (Math.pow((x-0),2.)) + (Math.pow((y-0),2.)) ); }
public double getDistanceFromOrigin() { return Math.sqrt((x*x)+(y*y)); }//end getDistanceFromOrigin
public boolean isPair(){if(cards.size()!=0){for(int i=0; i<= cards.size(); i++){for(int j=0; j<=cards.size();j++){int counter= 0;if (cards.get(i).getVal()== cards.get(j).getVal()){counter++;if(counter ==2){return true;}//end ifelse return false;}//end if}//end forreturn false;}//end for}//end ifreturn false;}//end pair()
//10, 4 and 14 could be covered in javaDocpublic boolean isRoyalFlush() { boolean isRoyalFlush;//SO MUCH TYPING for(int i = 0; i < 5; i++) { if( isFlush() == true && isStraight() == true) { if(hand.get(0).getVal()== 10 && hand.get(4).getVal()== 14) { return true; }//end if }//end if }//end for return false; }//end isRoyalFlush()
public boolean isRoyalFlush(){ boolean isRoyalFlush;//SO MUCH TYPING for(int i = 0; i < 5; i++) if( isFlush()==true && isStraight()==true && hand.get(0).getVal()== 10 && hand.get(4).getVal()== 14)
return true; return false; }//end isRoyalFlush()