Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bigformatgoldfish;
- import java.util.Arrays.*;
- import java.util.Random;
- public class BigFormatGoldfish {
- public static void main(String[] args) {
- Deck deck=new Deck();
- int NumberOfSimulationsPerDeck=5000;
- double FastestTurn=50;
- double KillTurn;
- int OptimalOneDrops=0;
- int OptimalTwoDrops=0;
- int OptimalThreeDrops=0;
- int OptimalBolts=0;
- int OptimalGeists=0;
- int OptimalLands=0;
- for (int DoubleOneDropCount=0; DoubleOneDropCount<=10; DoubleOneDropCount++){
- for (int DoubleTwoDropCount=0; DoubleTwoDropCount<=10; DoubleTwoDropCount++){
- for (int DoubleThreeDropCount=0; DoubleThreeDropCount<=3; DoubleThreeDropCount++){
- for (int DoubleBoltCount=0; DoubleBoltCount<=10; DoubleBoltCount++){
- for (int GeistCount=0; GeistCount<=4; GeistCount++){
- int GoodOneDropCount=4;
- int GoodTwoDropCount=4;
- int GoodBoltCount=4;
- int LandCount=60-2*DoubleOneDropCount-2*DoubleTwoDropCount-2*DoubleThreeDropCount-2*DoubleBoltCount-GoodOneDropCount-GoodTwoDropCount-GoodBoltCount-GeistCount;
- if (LandCount>=15 && LandCount<=25) {
- deck.SetDeck(2*DoubleOneDropCount,2*DoubleTwoDropCount,2*DoubleThreeDropCount,2*DoubleBoltCount,GoodOneDropCount,GoodTwoDropCount,GeistCount,GoodBoltCount,LandCount);
- deck.PrintDeckBrief();
- KillTurn=AverageKillTurnForRandomHand(deck,7,NumberOfSimulationsPerDeck);
- System.out.println(" "+KillTurn);
- if (KillTurn<FastestTurn){
- FastestTurn=KillTurn;
- OptimalOneDrops=2*DoubleOneDropCount;
- OptimalTwoDrops=2*DoubleTwoDropCount;
- OptimalThreeDrops=2*DoubleThreeDropCount;
- OptimalBolts=2*DoubleBoltCount;
- OptimalLands=LandCount;
- OptimalGeists=GeistCount;
- }
- }
- }
- }
- }
- }
- }
- System.out.println("----------------");
- System.out.print("The optimal deck after the grid-enumeration at a small number of simulations per deck was:");
- deck.SetDeck(OptimalOneDrops,OptimalTwoDrops,OptimalThreeDrops,OptimalBolts,4,4,OptimalGeists,4,OptimalLands);
- deck.PrintDeckBrief();
- System.out.println();
- System.out.println("----------------");
- NumberOfSimulationsPerDeck=10000;
- int NewOptimalOneDrops=0;
- int NewOptimalTwoDrops=0;
- int NewOptimalThreeDrops=0;
- int NewOptimalBolts=0;
- int NewOptimalLands=0;
- int NewOptimalGeists=0;
- boolean ContinueLocalSearch=true;
- do {
- FastestTurn=50;
- for (int OneDropCount=Math.max(0,OptimalOneDrops-2); OneDropCount<=Math.min(60,OptimalOneDrops+2); OneDropCount++){
- for (int TwoDropCount=Math.max(0,OptimalTwoDrops-2); TwoDropCount<=Math.min(60,OptimalTwoDrops+2); TwoDropCount++){
- for (int ThreeDropCount=Math.max(0,OptimalThreeDrops-2); ThreeDropCount<=Math.min(60,OptimalThreeDrops+2); ThreeDropCount++){
- for (int BoltCount=Math.max(0,OptimalBolts-2); BoltCount<=Math.min(60,OptimalBolts+2); BoltCount++){
- for (int GeistCount=0; GeistCount<=4; GeistCount++){
- int GoodOneDropCount=4;
- int GoodTwoDropCount=4;
- int GoodBoltCount=4;
- int LandCount=60-OneDropCount-TwoDropCount-ThreeDropCount-BoltCount-GoodOneDropCount-GoodTwoDropCount-GeistCount-GoodBoltCount;
- if (LandCount>=Math.max(0,OptimalLands-3) && LandCount<=Math.min(60,OptimalLands+3)) {
- deck.SetDeck(OneDropCount,TwoDropCount,ThreeDropCount,BoltCount,GoodOneDropCount,GoodTwoDropCount,GeistCount,GoodBoltCount,LandCount);
- deck.PrintDeckBrief();
- KillTurn=AverageKillTurnForRandomHand(deck,7,NumberOfSimulationsPerDeck);
- System.out.println(" "+KillTurn);
- if (KillTurn<FastestTurn){
- FastestTurn=KillTurn;
- NewOptimalOneDrops=OneDropCount;
- NewOptimalTwoDrops=TwoDropCount;
- NewOptimalThreeDrops=ThreeDropCount;
- NewOptimalBolts=BoltCount;
- NewOptimalGeists=GeistCount;
- NewOptimalLands=LandCount;
- }
- }
- }
- }
- }
- } }
- if (Math.abs(NewOptimalOneDrops-OptimalOneDrops)+Math.abs(NewOptimalTwoDrops-OptimalTwoDrops)+Math.abs(NewOptimalThreeDrops-OptimalThreeDrops)+Math.abs(NewOptimalBolts-OptimalBolts)+Math.abs(NewOptimalLands-OptimalLands)+Math.abs(NewOptimalGeists-OptimalGeists)<=2) {ContinueLocalSearch=false;}
- OptimalOneDrops=NewOptimalOneDrops;
- OptimalTwoDrops=NewOptimalTwoDrops;
- OptimalThreeDrops=NewOptimalThreeDrops;
- OptimalBolts=NewOptimalBolts;
- OptimalGeists=NewOptimalGeists;
- OptimalLands=NewOptimalLands;
- System.out.println("----------------");
- System.out.print("The optimal deck after the local search was:");
- deck.SetDeck(OptimalOneDrops,OptimalTwoDrops,OptimalThreeDrops,OptimalBolts,4,4,OptimalGeists,4,OptimalLands);
- deck.PrintDeckBrief();
- System.out.println();
- System.out.println("----------------");
- } while (ContinueLocalSearch);
- NumberOfSimulationsPerDeck=50000;
- ContinueLocalSearch=true;
- do {
- FastestTurn=50;
- for (int OneDropCount=Math.max(0,OptimalOneDrops-1); OneDropCount<=Math.min(60,OptimalOneDrops+1); OneDropCount++){
- for (int TwoDropCount=Math.max(0,OptimalTwoDrops-1); TwoDropCount<=Math.min(60,OptimalTwoDrops+1); TwoDropCount++){
- for (int ThreeDropCount=Math.max(0,OptimalThreeDrops-1); ThreeDropCount<=Math.min(60,OptimalThreeDrops+1); ThreeDropCount++){
- for (int BoltCount=Math.max(0,OptimalBolts-1); BoltCount<=Math.min(60,OptimalBolts+1); BoltCount++){
- for (int GeistCount=Math.max(0,OptimalGeists-1); GeistCount<=4; GeistCount++){
- int GoodOneDropCount=4;
- int GoodTwoDropCount=4;
- int GoodBoltCount=4;
- int LandCount=60-OneDropCount-TwoDropCount-ThreeDropCount-BoltCount-GoodOneDropCount-GoodTwoDropCount-GeistCount-GoodBoltCount;
- if (LandCount>=Math.max(0,OptimalLands-2) && LandCount<=Math.min(60,OptimalLands+2)) {
- deck.SetDeck(OneDropCount,TwoDropCount,ThreeDropCount,BoltCount,GoodOneDropCount,GoodTwoDropCount,GeistCount,GoodBoltCount,LandCount);
- deck.PrintDeckBrief();
- KillTurn=AverageKillTurnForRandomHand(deck,7,NumberOfSimulationsPerDeck);
- System.out.println(" "+KillTurn);
- if (KillTurn<FastestTurn){
- FastestTurn=KillTurn;
- NewOptimalOneDrops=OneDropCount;
- NewOptimalTwoDrops=TwoDropCount;
- NewOptimalThreeDrops=ThreeDropCount;
- NewOptimalBolts=BoltCount;
- NewOptimalGeists=GeistCount;
- NewOptimalLands=LandCount;
- }
- }
- }
- }
- }
- }}
- if (Math.abs(NewOptimalOneDrops-OptimalOneDrops)+Math.abs(NewOptimalTwoDrops-OptimalTwoDrops)+Math.abs(NewOptimalThreeDrops-OptimalThreeDrops)+Math.abs(NewOptimalBolts-OptimalBolts)+Math.abs(NewOptimalLands-OptimalLands)+Math.abs(NewOptimalGeists-OptimalGeists)==0) {ContinueLocalSearch=false;}
- OptimalOneDrops=NewOptimalOneDrops;
- OptimalTwoDrops=NewOptimalTwoDrops;
- OptimalThreeDrops=NewOptimalThreeDrops;
- OptimalGeists=NewOptimalGeists;
- OptimalBolts=NewOptimalBolts;
- OptimalLands=NewOptimalLands;
- System.out.println("----------------");
- System.out.print("The final optimal deck:");
- deck.SetDeck(OptimalOneDrops,OptimalTwoDrops,OptimalThreeDrops,OptimalBolts,4,4,OptimalGeists,4,OptimalLands);
- deck.PrintDeckBrief();
- System.out.println();
- System.out.println("----------------");
- } while (ContinueLocalSearch);
- }//end of main
- public static double AverageKillTurnForRandomHand(Deck deck, int StartingCards, int NumberOfIterations){
- Deck remainingdeck=new Deck();
- double AverageKillTurn=0;
- for (int IterationCounter=1; IterationCounter<=NumberOfIterations; IterationCounter++){
- OpeningHand openinghand=GiveOpeningHandAfterMulls(deck, StartingCards);
- remainingdeck.SetDeck(deck.NumberOf1Cost-openinghand.NumberOf1Cost,deck.NumberOf2Cost-openinghand.NumberOf2Cost,deck.NumberOf3Cost-openinghand.NumberOf3Cost,deck.NumberOfBolts-openinghand.NumberOfBolts,deck.NumberOfGood1Cost-openinghand.NumberOfGood1Cost,deck.NumberOfGood2Cost-openinghand.NumberOfGood2Cost,deck.NumberOfGood3Cost-openinghand.NumberOfGood3Cost,deck.NumberOfGoodBolts-openinghand.NumberOfGoodBolts,deck.NumberOfLands-openinghand.NumberOfLands);
- AverageKillTurn=AverageKillTurn+TurnKill(remainingdeck,openinghand);
- if ( IterationCounter % 200000 == 0) {System.out.print(".");}
- }
- return AverageKillTurn/(NumberOfIterations+0.0);
- }//end of AverageKillTurnForRandomHand
- static OpeningHand GiveOpeningHandAfterMulls (Deck deck, int StartingCards) {
- Deck remainingdeck=new Deck();
- OpeningHand openinghand=new OpeningHand();
- int TypeOfCardDrawn;
- boolean KeepHand=false;
- for (int OpeningHandSize=7; OpeningHandSize>=1; OpeningHandSize--){
- if (KeepHand==false && StartingCards>=OpeningHandSize){
- openinghand.ResetHand();
- remainingdeck.SetDeck(deck.NumberOf1Cost,deck.NumberOf2Cost,deck.NumberOf3Cost,deck.NumberOfBolts,deck.NumberOfGood1Cost,deck.NumberOfGood2Cost,deck.NumberOfGood3Cost,deck.NumberOfGoodBolts,deck.NumberOfLands);
- for (int CardsDrawn=0; CardsDrawn<OpeningHandSize; CardsDrawn++){
- TypeOfCardDrawn=remainingdeck.DrawCard();
- if (TypeOfCardDrawn==1) {openinghand.NumberOf1Cost++;}
- if (TypeOfCardDrawn==2) {openinghand.NumberOf2Cost++;}
- if (TypeOfCardDrawn==3) {openinghand.NumberOf3Cost++;}
- if (TypeOfCardDrawn==4) {openinghand.NumberOfBolts++;}
- if (TypeOfCardDrawn==5) {openinghand.NumberOfGood1Cost++;}
- if (TypeOfCardDrawn==6) {openinghand.NumberOfGood2Cost++;}
- if (TypeOfCardDrawn==7) {openinghand.NumberOfGood3Cost++;}
- if (TypeOfCardDrawn==8) {openinghand.NumberOfGoodBolts++;}
- if (TypeOfCardDrawn==9) {openinghand.NumberOfLands++;}
- }
- KeepHand=true;
- if (OpeningHandSize>1) {
- if (openinghand.NumberOfLands>4) {KeepHand=false;}
- if (openinghand.NumberOfLands==0) {KeepHand=false;}
- }
- }
- }
- return openinghand;
- }//end of GiveOpeningHandAfterMulls
- static int TurnKill(Deck remainingdeck, OpeningHand openinghand) {
- int OneCostPower=1;
- int TwoCostPower=2;
- int ThreeCostPower=3;
- int BoltDamage=2;
- int GoodOneCostPower=2;
- int GoodTwoCostPower=4;
- int GoodThreeCostPower=6;
- int GoodBoltDamage=3;
- int Turn=0;
- int OppLife=20;
- int ManaLeft;
- int TypeOfCardDrawn;
- int OneDropsInPlay=0;
- int TwoDropsInPlay=0;
- int ThreeDropsInPlay=0;
- int GoodOneDropsInPlay=0;
- int GoodTwoDropsInPlay=0;
- int GoodThreeDropsInPlay=0;
- int LandsInPlay=0;
- int OneDropsInHand=openinghand.NumberOf1Cost;
- int TwoDropsInHand=openinghand.NumberOf2Cost;
- int ThreeDropsInHand=openinghand.NumberOf3Cost;
- int BoltsInHand=openinghand.NumberOfBolts;
- int GoodOneDropsInHand=openinghand.NumberOfGood1Cost;
- int GoodTwoDropsInHand=openinghand.NumberOfGood2Cost;
- int GoodThreeDropsInHand=openinghand.NumberOfGood3Cost;
- int GoodBoltsInHand=openinghand.NumberOfGoodBolts;
- int LandsInHand=openinghand.NumberOfLands;
- do {
- Turn++;
- if (Turn==1) {
- if (LandsInHand>=1) {LandsInPlay++; LandsInHand--;}
- ManaLeft=LandsInPlay;
- if (GoodOneDropsInHand>=1 && ManaLeft==1) {GoodOneDropsInPlay++; ManaLeft--; GoodOneDropsInHand--;}
- if (OneDropsInHand>=1 && ManaLeft==1) {OneDropsInPlay++; ManaLeft--; OneDropsInHand--;}
- if (GoodBoltsInHand>=1 && ManaLeft==1) {OppLife=OppLife-GoodBoltDamage; ManaLeft--; GoodBoltsInHand--;}
- if (BoltsInHand>=1 && ManaLeft==1) {OppLife=OppLife-BoltDamage; ManaLeft--; BoltsInHand--;}
- } //end of the first turn
- if (Turn>1) {
- TypeOfCardDrawn=remainingdeck.DrawCard();
- if (TypeOfCardDrawn==1) {OneDropsInHand++;}
- if (TypeOfCardDrawn==2) {TwoDropsInHand++;}
- if (TypeOfCardDrawn==3) {ThreeDropsInHand++;}
- if (TypeOfCardDrawn==4) {BoltsInHand++;}
- if (TypeOfCardDrawn==5) {GoodOneDropsInHand++;}
- if (TypeOfCardDrawn==6) {GoodTwoDropsInHand++;}
- if (TypeOfCardDrawn==7) {GoodThreeDropsInHand++;}
- if (TypeOfCardDrawn==8) {GoodBoltsInHand++;}
- if (TypeOfCardDrawn==9) {LandsInHand++;}
- if (LandsInHand>=1) {LandsInPlay++; LandsInHand--;}
- ManaLeft=LandsInPlay;
- OppLife=OppLife-OneCostPower*OneDropsInPlay;
- OppLife=OppLife-TwoCostPower*TwoDropsInPlay;
- OppLife=OppLife-ThreeCostPower*ThreeDropsInPlay;
- OppLife=OppLife-GoodOneCostPower*GoodOneDropsInPlay;
- OppLife=OppLife-GoodTwoCostPower*GoodTwoDropsInPlay;
- OppLife=OppLife-GoodThreeCostPower*GoodThreeDropsInPlay;
- int CastableVariousBoltDamage=Math.min(GoodBoltsInHand, ManaLeft)*GoodBoltDamage+Math.min(BoltsInHand, ManaLeft-Math.min(GoodBoltsInHand, ManaLeft))*BoltDamage;
- if (OppLife<=CastableVariousBoltDamage) {OppLife=0;}
- int CastableGoodThreeDrops=Math.min(GoodThreeDropsInHand, ManaLeft/3);
- if (CastableGoodThreeDrops>=1) {GoodThreeDropsInPlay=GoodThreeDropsInPlay+CastableGoodThreeDrops; ManaLeft=ManaLeft-3*CastableGoodThreeDrops; GoodThreeDropsInHand=GoodThreeDropsInHand-CastableGoodThreeDrops;}
- int CastableThreeDrops=Math.min(ThreeDropsInHand, ManaLeft/3);
- if (CastableThreeDrops>=1) {ThreeDropsInPlay=ThreeDropsInPlay+CastableThreeDrops; ManaLeft=ManaLeft-3*CastableThreeDrops; ThreeDropsInHand=ThreeDropsInHand-CastableThreeDrops;}
- int CastableGoodTwoDrops=Math.min(GoodTwoDropsInHand, ManaLeft/2);
- if (CastableGoodTwoDrops>=1) {GoodTwoDropsInPlay=GoodTwoDropsInPlay+CastableGoodTwoDrops; ManaLeft=ManaLeft-2*CastableGoodTwoDrops; GoodTwoDropsInHand=GoodTwoDropsInHand-CastableGoodTwoDrops;}
- int CastableTwoDrops=Math.min(TwoDropsInHand, ManaLeft/2);
- if (CastableTwoDrops>=1) {TwoDropsInPlay=TwoDropsInPlay+CastableTwoDrops; ManaLeft=ManaLeft-2*CastableTwoDrops; TwoDropsInHand=TwoDropsInHand-CastableTwoDrops;}
- int CastableGoodOneDrops=Math.min(GoodOneDropsInHand, ManaLeft);
- if (CastableGoodOneDrops>=1) {GoodOneDropsInPlay=GoodOneDropsInPlay+CastableGoodOneDrops; ManaLeft=ManaLeft-CastableGoodOneDrops; GoodOneDropsInHand=GoodOneDropsInHand-CastableGoodOneDrops;}
- int CastableOneDrops=Math.min(OneDropsInHand, ManaLeft);
- if (CastableOneDrops>=1) {OneDropsInPlay=OneDropsInPlay+CastableOneDrops; ManaLeft=ManaLeft-CastableOneDrops; OneDropsInHand=OneDropsInHand-CastableOneDrops;}
- int CastableGoodBolts=Math.min(GoodBoltsInHand, ManaLeft);
- if (CastableGoodBolts>=1) {OppLife=OppLife-CastableGoodBolts*GoodBoltDamage; ManaLeft=ManaLeft-CastableGoodBolts; GoodBoltsInHand=GoodBoltsInHand-CastableGoodBolts;}
- int CastableBolts=Math.min(BoltsInHand, ManaLeft);
- if (CastableBolts>=1) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
- } //end of a turn in which we drew a card and attacked
- } while (OppLife>0 &&Turn<=50);
- return Turn;
- }//end of TurnKill
- }//end of OptimalAggroGoldfishDeck
- class OpeningHand {
- int NumberOf1Cost;
- int NumberOf2Cost;
- int NumberOf3Cost;
- int NumberOfBolts;
- int NumberOfLands;
- int NumberOfGood1Cost;
- int NumberOfGood2Cost;
- int NumberOfGood3Cost;
- int NumberOfGoodBolts;
- void ResetHand(){
- NumberOf1Cost=0;
- NumberOf2Cost=0;
- NumberOf3Cost=0;
- NumberOfBolts=0;
- NumberOfLands=0;
- NumberOfGood1Cost=0;
- NumberOfGood2Cost=0;
- NumberOfGood3Cost=0;
- NumberOfGoodBolts=0;
- }
- void SetHand (int Nr1Cost, int Nr2Cost, int Nr3Cost, int NrBolts, int NrGood1Cost, int NrGood2Cost, int NrGood3Cost, int NrGoodBolts, int NrLands) {
- NumberOf1Cost=Nr1Cost;
- NumberOf2Cost=Nr2Cost;
- NumberOf3Cost=Nr3Cost;
- NumberOfBolts=NrBolts;
- NumberOfLands=NrLands;
- NumberOfGood1Cost=NrGood1Cost;
- NumberOfGood2Cost=NrGood2Cost;
- NumberOfGood3Cost=NrGood3Cost;
- NumberOfGoodBolts=NrGoodBolts;
- }
- }//end of OpeningHand
- class Deck {
- int NumberOf1Cost;
- int NumberOf2Cost;
- int NumberOf3Cost;
- int NumberOfBolts;
- int NumberOfLands;
- int NumberOfGood1Cost;
- int NumberOfGood2Cost;
- int NumberOfGood3Cost;
- int NumberOfGoodBolts;
- void PrintDeckBrief () {
- if(NumberOf1Cost<10) {System.out.print("0");}
- System.out.print(NumberOf1Cost+" ");
- if(NumberOf2Cost<10) {System.out.print("0");}
- System.out.print(NumberOf2Cost+" ");
- if(NumberOf3Cost<10) {System.out.print("0");}
- System.out.print(NumberOf3Cost+" ");
- if(NumberOfBolts<10) {System.out.print("0");}
- System.out.print(NumberOfBolts+" ");
- if(NumberOfGood1Cost<10) {System.out.print("0");}
- System.out.print(NumberOfGood1Cost+" ");
- if(NumberOfGood2Cost<10) {System.out.print("0");}
- System.out.print(NumberOfGood2Cost+" ");
- if(NumberOfGood3Cost<10) {System.out.print("0");}
- System.out.print(NumberOfGood3Cost+" ");
- if(NumberOfGoodBolts<10) {System.out.print("0");}
- System.out.print(NumberOfGoodBolts+" ");
- if(NumberOfLands<10) {System.out.print("0");}
- System.out.print(NumberOfLands);
- System.out.print(" ");
- }
- void SetDeck (int Nr1Cost, int Nr2Cost, int Nr3Cost, int NrBolts, int NrGood1Cost, int NrGood2Cost, int NrGood3Cost, int NrGoodBolts, int NrLands) {
- NumberOf1Cost=Nr1Cost;
- NumberOf2Cost=Nr2Cost;
- NumberOf3Cost=Nr3Cost;
- NumberOfBolts=NrBolts;
- NumberOfLands=NrLands;
- NumberOfGood1Cost=NrGood1Cost;
- NumberOfGood2Cost=NrGood2Cost;
- NumberOfGood3Cost=NrGood3Cost;
- NumberOfGoodBolts=NrGoodBolts;
- }
- int NrOfCards(){
- return NumberOf1Cost+NumberOf2Cost+NumberOf3Cost+NumberOfBolts+NumberOfLands+NumberOfGood1Cost+NumberOfGood2Cost+NumberOfGood3Cost+NumberOfGoodBolts;
- }
- int DrawCard (){
- Random generator = new Random();
- int RandomIntegerBetweenOneAndDeckSize=generator.nextInt( this.NrOfCards() )+1;
- int CardType=0;
- int OneCostCutoff=NumberOf1Cost;
- int TwoCostCutoff=OneCostCutoff+NumberOf2Cost;
- int ThreeCostCutoff=TwoCostCutoff+NumberOf3Cost;
- int BoltCutoff=ThreeCostCutoff+NumberOfBolts;
- int GoodOneCostCutoff=BoltCutoff+NumberOfGood1Cost;
- int GoodTwoCostCutoff=GoodOneCostCutoff+NumberOfGood2Cost;
- int GoodThreeCostCutoff=GoodTwoCostCutoff+NumberOfGood3Cost;
- int LandCutoff=GoodThreeCostCutoff+NumberOfLands;
- if (RandomIntegerBetweenOneAndDeckSize<=OneCostCutoff) {CardType=1; this.NumberOf1Cost--;}
- if (RandomIntegerBetweenOneAndDeckSize>OneCostCutoff && RandomIntegerBetweenOneAndDeckSize<=TwoCostCutoff) {CardType=2; this.NumberOf2Cost--;}
- if (RandomIntegerBetweenOneAndDeckSize>TwoCostCutoff && RandomIntegerBetweenOneAndDeckSize<=ThreeCostCutoff) {CardType=3; this.NumberOf3Cost--;}
- if (RandomIntegerBetweenOneAndDeckSize>ThreeCostCutoff && RandomIntegerBetweenOneAndDeckSize<=BoltCutoff) {CardType=4; this.NumberOfBolts--;}
- if (RandomIntegerBetweenOneAndDeckSize>BoltCutoff && RandomIntegerBetweenOneAndDeckSize<=GoodOneCostCutoff) {CardType=5; this.NumberOfGood1Cost--;}
- if (RandomIntegerBetweenOneAndDeckSize>GoodOneCostCutoff && RandomIntegerBetweenOneAndDeckSize<=GoodTwoCostCutoff) {CardType=6; this.NumberOfGood2Cost--;}
- if (RandomIntegerBetweenOneAndDeckSize>GoodTwoCostCutoff && RandomIntegerBetweenOneAndDeckSize<=GoodThreeCostCutoff) {CardType=7; this.NumberOfGood3Cost--;}
- if (RandomIntegerBetweenOneAndDeckSize>GoodThreeCostCutoff && RandomIntegerBetweenOneAndDeckSize<=LandCutoff) {CardType=9; this.NumberOfLands--;}
- return CardType;
- }
- }//end of Deck
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement