Advertisement
frankkarsten

MTG Optimal Aggro Goldfish Deck

Sep 12th, 2013
1,815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 20.01 KB | None | 0 0
  1. package optimalaggrogoldfishdeck;
  2.  
  3. import java.util.Arrays.*;
  4. import java.util.Random;
  5.  
  6. /*
  7. * Note: I am not a professional programmer, so if you see obvious spots for improvement, then please send me a message :)
  8. * Comment: I turned my original spaghetti code---especially the mulligan strategy optimization was a mess, originally---into something a bit more structured, removed superflous print-statements that I used for debugging, and changed several variable names into more descriptive ones.
  9. * The end result is below. Though explanations of the code and loops are lacking, I still hope that the raw code is somewhat readable. The program output is in column-form that is easy to copy-paste into a spreadsheet for further analysis.
  10. * While improving my code, I found one mistake: in my original code for turn 4 when you cast 2 two-drops, I had "TwoDropsInPlay=TwoDropsInPlay-2" instead of "TwoDropsInPlay=TwoDropsInPlay+2"
  11. * This situation comes up very rarely---I failed to spot it while debugging---and even if it does, my typo often doesn't even affect the kill-turn. Yet, it is a minor difference that should reduce the actual kill-turns by a little bit and slightly affects the optimal decks.
  12. * Running the simualations again with the correct code for this 4-mana 2 two-drop situation, I found that the optimum for the powerful format actually had -1 Savannah Lions +1 Lightning Bolt compared to the "optimal deck" in my article. For the weak format, the difference was slightly larger. The optimum for the weak format actually had -1 Mon's Goblin Raiders +2 Grizzly Bear -2 Shock +1 land compared to the "optimal deck" in my article. I'll address that in my next article.
  13. */
  14.  
  15. public class OptimalAggroGoldfishDeck {
  16.  
  17.     public static void main(String[] args) {
  18.        
  19.         Deck deck=new Deck();
  20.         boolean[][][][][][] KeepOpeningHand = new boolean[8][8][8][8][8][8];
  21.         boolean TakeTimeToFindOptimalMulliganStrategy = true;
  22.         if (TakeTimeToFindOptimalMulliganStrategy==false) {KeepOpeningHand=GiveLooseMulliganStrategy();}
  23.         int NumberOfSimulationsPerDeck=500000;
  24.        
  25.         for (int OneDropCount=11; OneDropCount<=15; OneDropCount++){
  26.             for (int TwoDropCount=9; TwoDropCount<=13; TwoDropCount++){
  27.                 for (int ThreeDropCount=1; ThreeDropCount<=5; ThreeDropCount++){
  28.                     for (int BoltCount=12; BoltCount<=16; BoltCount++){
  29.                         int LandCount=60-OneDropCount-TwoDropCount-ThreeDropCount-BoltCount;
  30.                         if (LandCount>=17 && LandCount<=21) {
  31.                             deck.SetDeck(OneDropCount,TwoDropCount,ThreeDropCount,BoltCount,LandCount);
  32.                             deck.PrintDeckBrief();
  33.                             if (TakeTimeToFindOptimalMulliganStrategy==true) {KeepOpeningHand=GiveOptimalMulliganStrategy(deck);}
  34.                             System.out.println(" "+AverageKillTurnForRandomHand(deck,7,KeepOpeningHand,NumberOfSimulationsPerDeck));
  35.                         }
  36.                     }
  37.                 }
  38.             }
  39.         }
  40.        
  41.     }//end of main
  42.  
  43.     public static boolean[][][][][][] GiveOptimalMulliganStrategy(Deck deck) {
  44.         boolean[][][][][][] KeepOpeningHand = new boolean[8][8][8][8][8][8];
  45.         OpeningHand openinghand=new OpeningHand();
  46.         int NumberOfSimulationsPerOpeningHandSize=10000;
  47.         int OriginalNr1Cost=deck.NumberOf1Cost;
  48.         int OriginalNr2Cost=deck.NumberOf2Cost;
  49.         int OriginalNr3Cost=deck.NumberOf3Cost;
  50.         int OriginalNrBolts=deck.NumberOfBolts;
  51.         int OriginalNrLands=deck.NumberOfLands;
  52.         double CutOffTurn = AverageKillTurnForRandomHand(deck,1,KeepOpeningHand,NumberOfSimulationsPerOpeningHandSize);
  53.         for (int StartingCards=2; StartingCards<=7; StartingCards++){
  54.             System.out.print(".");
  55.             for (int OneDropCount=0; OneDropCount<=OriginalNr1Cost && OneDropCount<=StartingCards; OneDropCount++){
  56.                 for (int TwoDropCount=0; TwoDropCount<=OriginalNr2Cost && TwoDropCount+OneDropCount<=StartingCards; TwoDropCount++){
  57.                     for  (int ThreeDropCount=0; ThreeDropCount<=OriginalNr3Cost && ThreeDropCount+TwoDropCount+OneDropCount<=StartingCards; ThreeDropCount++){
  58.                         for (int BoltCount=0; BoltCount<=OriginalNrBolts && BoltCount+ThreeDropCount+TwoDropCount+OneDropCount<=StartingCards; BoltCount++){
  59.                             int LandCount=StartingCards-OneDropCount-TwoDropCount-ThreeDropCount-BoltCount;
  60.                             if (LandCount<=OriginalNrLands){
  61.                                 openinghand.SetHand(OneDropCount, TwoDropCount, ThreeDropCount, BoltCount, LandCount);
  62.                                 deck.SetDeck(OriginalNr1Cost,OriginalNr2Cost,OriginalNr3Cost,OriginalNrBolts,OriginalNrLands);
  63.                                 double AvgKillTurn=AverageKillTurnForSpecificHand(deck,openinghand);
  64.                                 if (AvgKillTurn<=CutOffTurn) { KeepOpeningHand[StartingCards][OneDropCount][TwoDropCount][ThreeDropCount][BoltCount][LandCount]=true;}
  65.                                 if (AvgKillTurn>CutOffTurn) { KeepOpeningHand[StartingCards][OneDropCount][TwoDropCount][ThreeDropCount][BoltCount][LandCount]=false;}
  66.                                 }
  67.                             }
  68.                         }
  69.                     }
  70.                 }
  71.             deck.SetDeck(OriginalNr1Cost,OriginalNr2Cost,OriginalNr3Cost,OriginalNrBolts,OriginalNrLands);
  72.             if (StartingCards<7) {CutOffTurn=AverageKillTurnForRandomHand(deck,StartingCards,KeepOpeningHand,NumberOfSimulationsPerOpeningHandSize);}
  73.         }
  74.         return KeepOpeningHand;
  75.     }
  76.  
  77.     public static boolean[][][][][][] GiveLooseMulliganStrategy() {
  78.         boolean[][][][][][] KeepOpeningHand = new boolean[8][8][8][8][8][8];
  79.         for (int StartingCards=2; StartingCards<=7; StartingCards++){
  80.             for (int OneDropCount=0; OneDropCount<=StartingCards; OneDropCount++){
  81.                 for (int TwoDropCount=0; TwoDropCount+OneDropCount<=StartingCards; TwoDropCount++){
  82.                     for  (int ThreeDropCount=0; ThreeDropCount+TwoDropCount+OneDropCount<=StartingCards; ThreeDropCount++){
  83.                         for (int BoltCount=0; BoltCount+ThreeDropCount+TwoDropCount+OneDropCount<=StartingCards; BoltCount++){
  84.                             int LandCount=StartingCards-OneDropCount-TwoDropCount-ThreeDropCount-BoltCount;
  85.                             KeepOpeningHand[StartingCards][OneDropCount][TwoDropCount][ThreeDropCount][BoltCount][LandCount]=false;
  86.                             if (LandCount>=1 && LandCount<=4) {KeepOpeningHand[StartingCards][OneDropCount][TwoDropCount][ThreeDropCount][BoltCount][LandCount]=true;}
  87.                         }
  88.                     }
  89.                 }
  90.             }
  91.         }
  92.         return KeepOpeningHand;
  93.     }
  94.    
  95.     public static double AverageKillTurnForSpecificHand(Deck deck, OpeningHand openinghand){
  96.         int NumberOfIterations=2000;
  97.         Deck remainingdeck=new Deck();
  98.         double AverageKillTurn=0;
  99.         for (int IterationCounter=1; IterationCounter<=NumberOfIterations; IterationCounter++){
  100.             remainingdeck.SetDeck(deck.NumberOf1Cost-openinghand.NumberOf1Cost,deck.NumberOf2Cost-openinghand.NumberOf2Cost,deck.NumberOf3Cost-openinghand.NumberOf3Cost,deck.NumberOfBolts-openinghand.NumberOfBolts,deck.NumberOfLands-openinghand.NumberOfLands);
  101.             AverageKillTurn=AverageKillTurn+TurnKill(remainingdeck,openinghand);
  102.         }
  103.         return (AverageKillTurn/(NumberOfIterations+0.0));
  104.     }//end of AverageKillTurnForSpecificHand
  105.  
  106.     public static double AverageKillTurnForRandomHand(Deck deck, int StartingCards, boolean[][][][][][] KeepOpeningHand, int NumberOfIterations){
  107.         Deck remainingdeck=new Deck();
  108.         double AverageKillTurn=0;
  109.         for (int IterationCounter=1; IterationCounter<=NumberOfIterations; IterationCounter++){
  110.             OpeningHand openinghand=GiveOpeningHandAfterMulls(deck, StartingCards, KeepOpeningHand);
  111.             remainingdeck.SetDeck(deck.NumberOf1Cost-openinghand.NumberOf1Cost,deck.NumberOf2Cost-openinghand.NumberOf2Cost,deck.NumberOf3Cost-openinghand.NumberOf3Cost,deck.NumberOfBolts-openinghand.NumberOfBolts,deck.NumberOfLands-openinghand.NumberOfLands);
  112.             AverageKillTurn=AverageKillTurn+TurnKill(remainingdeck,openinghand);
  113.             if ( IterationCounter % 200000 == 0) {System.out.print(".");}
  114.         }
  115.         return AverageKillTurn/(NumberOfIterations+0.0);
  116.     }//end of AverageKillTurnForRandomHand
  117.    
  118.     static OpeningHand GiveOpeningHandAfterMulls (Deck deck, int StartingCards, boolean[][][][][][] KeepOpeningHand) {
  119.        
  120.         Deck remainingdeck=new Deck();
  121.         OpeningHand openinghand=new OpeningHand();
  122.         int TypeOfCardDrawn;
  123.         boolean KeepHand=false;
  124.        
  125.         for (int OpeningHandSize=7; OpeningHandSize>=1; OpeningHandSize--){
  126.             if (KeepHand==false && StartingCards>=OpeningHandSize){
  127.                 openinghand.ResetHand();
  128.                 remainingdeck.SetDeck(deck.NumberOf1Cost,deck.NumberOf2Cost,deck.NumberOf3Cost,deck.NumberOfBolts,deck.NumberOfLands);
  129.                 for (int CardsDrawn=0; CardsDrawn<OpeningHandSize; CardsDrawn++){
  130.                     TypeOfCardDrawn=remainingdeck.DrawCard();
  131.                     if (TypeOfCardDrawn==1) {openinghand.NumberOf1Cost++;}
  132.                     if (TypeOfCardDrawn==2) {openinghand.NumberOf2Cost++;}
  133.                     if (TypeOfCardDrawn==3) {openinghand.NumberOf3Cost++;}
  134.                     if (TypeOfCardDrawn==4) {openinghand.NumberOfBolts++;}
  135.                     if (TypeOfCardDrawn==5) {openinghand.NumberOfLands++;}
  136.                 }
  137.                 KeepHand=true;
  138.                 if (OpeningHandSize>1) {
  139.                     if (KeepOpeningHand[OpeningHandSize][openinghand.NumberOf1Cost][openinghand.NumberOf2Cost][openinghand.NumberOf3Cost][openinghand.NumberOfBolts][openinghand.NumberOfLands]==false) {KeepHand=false;}
  140.                 }
  141.             }
  142.         }
  143.        
  144.         return openinghand;
  145.     }//end of GiveOpeningHandAfterMulls
  146.    
  147.     static int TurnKill(Deck remainingdeck, OpeningHand openinghand) {
  148.        
  149.         int OneCostPower=1;
  150.         int TwoCostPower=2;
  151.         int ThreeCostPower=3;
  152.         int BoltDamage=2;
  153.        
  154.         int Turn=0;
  155.         int OppLife=20;
  156.         int ManaLeft;
  157.         int TypeOfCardDrawn;
  158.    
  159.         int OneDropsInPlay=0;
  160.         int TwoDropsInPlay=0;
  161.         int ThreeDropsInPlay=0;
  162.         int LandsInPlay=0;
  163.        
  164.         int OneDropsInHand=openinghand.NumberOf1Cost;
  165.         int TwoDropsInHand=openinghand.NumberOf2Cost;
  166.         int ThreeDropsInHand=openinghand.NumberOf3Cost;
  167.         int BoltsInHand=openinghand.NumberOfBolts;
  168.         int LandsInHand=openinghand.NumberOfLands;
  169.        
  170.         do {
  171.            
  172.             Turn++;
  173.            
  174.             if (Turn==1) {
  175.                
  176.                 if (LandsInHand>=1) {LandsInPlay++; LandsInHand--;}
  177.                 ManaLeft=LandsInPlay;
  178.                 if (OneDropsInHand>=1 && ManaLeft==1) {OneDropsInPlay++; ManaLeft--; OneDropsInHand--;}
  179.                 if (BoltsInHand>=1 && ManaLeft==1) {OppLife=OppLife-BoltDamage; ManaLeft--; BoltsInHand--;}
  180.                
  181.             } //end of the first turn
  182.            
  183.             if (Turn>1) {
  184.  
  185.                 TypeOfCardDrawn=remainingdeck.DrawCard();
  186.                 if (TypeOfCardDrawn==1) {OneDropsInHand++;}
  187.                 if (TypeOfCardDrawn==2) {TwoDropsInHand++;}
  188.                 if (TypeOfCardDrawn==3) {ThreeDropsInHand++;}
  189.                 if (TypeOfCardDrawn==4) {BoltsInHand++;}
  190.                 if (TypeOfCardDrawn==5) {LandsInHand++;}
  191.  
  192.                 if (LandsInHand>=1) {LandsInPlay++; LandsInHand--;}
  193.                 ManaLeft=LandsInPlay;
  194.                 OppLife=OppLife-OneCostPower*OneDropsInPlay;
  195.                 OppLife=OppLife-TwoCostPower*TwoDropsInPlay;
  196.                 OppLife=OppLife-ThreeCostPower*ThreeDropsInPlay;
  197.                
  198.                 if (ManaLeft==1) {
  199.                     int CastableBolts=Math.min(BoltsInHand, ManaLeft);
  200.                     if (OppLife<=CastableBolts*BoltDamage) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  201.                     if (OneDropsInHand>=1 && ManaLeft==1) {OneDropsInPlay++; ManaLeft--; OneDropsInHand--;}
  202.                     if (BoltsInHand>=1 && ManaLeft==1) {OppLife=OppLife-BoltDamage; ManaLeft--; BoltsInHand--;}
  203.                 }
  204.                
  205.                 if (ManaLeft==2) {
  206.                     int CastableBolts=Math.min(BoltsInHand, ManaLeft);
  207.                     if (OppLife<=CastableBolts*BoltDamage) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  208.                     if (TwoDropsInHand>=1 && ManaLeft==2) {TwoDropsInPlay++; ManaLeft=ManaLeft-2; TwoDropsInHand--;}
  209.                     int CastableOneDrops=Math.min(OneDropsInHand, ManaLeft);
  210.                     if (CastableOneDrops>=1) {OneDropsInPlay=OneDropsInPlay+CastableOneDrops; ManaLeft=ManaLeft-CastableOneDrops; OneDropsInHand=OneDropsInHand-CastableOneDrops;}
  211.                     CastableBolts=Math.min(BoltsInHand, ManaLeft);
  212.                     if (CastableBolts>=1) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  213.                 }
  214.  
  215.                 if (ManaLeft==3) {
  216.                     int CastableBolts=Math.min(BoltsInHand, ManaLeft);
  217.                     if (OppLife<=CastableBolts*BoltDamage) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  218.                     if (ThreeDropsInHand>=1 && ManaLeft==3) {ThreeDropsInPlay++; ManaLeft=ManaLeft-3; ThreeDropsInHand--;}
  219.                     if (TwoDropsInHand>=1 && ManaLeft>=2) {TwoDropsInPlay++; ManaLeft=ManaLeft-2; TwoDropsInHand--;}
  220.                     int CastableOneDrops=Math.min(OneDropsInHand, ManaLeft);
  221.                     if (CastableOneDrops>=1) {OneDropsInPlay=OneDropsInPlay+CastableOneDrops; ManaLeft=ManaLeft-CastableOneDrops; OneDropsInHand=OneDropsInHand-CastableOneDrops;}
  222.                     CastableBolts=Math.min(BoltsInHand, ManaLeft);
  223.                     if (CastableBolts>=1) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  224.                 }
  225.                
  226.                 if (ManaLeft==4) {
  227.                     int CastableBolts=Math.min(BoltsInHand, ManaLeft);
  228.                     if (OppLife<=CastableBolts*BoltDamage) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  229.                     int CastableTwoDrops=Math.min(TwoDropsInHand, ManaLeft/2);
  230.                     if (CastableTwoDrops==2) {TwoDropsInPlay=TwoDropsInPlay+2; ManaLeft=ManaLeft-4; TwoDropsInHand=TwoDropsInHand-2;}
  231.                     if (ThreeDropsInHand>=1 && ManaLeft>=3) {ThreeDropsInPlay++; ManaLeft=ManaLeft-3; ThreeDropsInHand--;}
  232.                     if (TwoDropsInHand>=1 && ManaLeft>=2) {TwoDropsInPlay++; ManaLeft=ManaLeft-2; TwoDropsInHand--;}
  233.                     int CastableOneDrops=Math.min(OneDropsInHand, ManaLeft);
  234.                     if (CastableOneDrops>=1) {OneDropsInPlay=OneDropsInPlay+CastableOneDrops; ManaLeft=ManaLeft-CastableOneDrops; OneDropsInHand=OneDropsInHand-CastableOneDrops;}
  235.                     CastableBolts=Math.min(BoltsInHand, ManaLeft);
  236.                     if (CastableBolts>=1) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  237.                 }
  238.                        
  239.                 if (ManaLeft>=5) {
  240.                     int CastableBolts=Math.min(BoltsInHand, ManaLeft);
  241.                     if (OppLife<=CastableBolts*BoltDamage) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  242.                     int CastableThreeDrops=Math.min(ThreeDropsInHand, ManaLeft/3);
  243.                     if (CastableThreeDrops>=1) {ThreeDropsInPlay=ThreeDropsInPlay+CastableThreeDrops; ManaLeft=ManaLeft-3*CastableThreeDrops; ThreeDropsInHand=ThreeDropsInHand-CastableThreeDrops;}
  244.                     int CastableTwoDrops=Math.min(TwoDropsInHand, ManaLeft/2);
  245.                     if (CastableTwoDrops>=1) {TwoDropsInPlay=TwoDropsInPlay+CastableTwoDrops; ManaLeft=ManaLeft-2*CastableTwoDrops; TwoDropsInHand=TwoDropsInHand-CastableTwoDrops;}
  246.                     int CastableOneDrops=Math.min(OneDropsInHand, ManaLeft);
  247.                     if (CastableOneDrops>=1) {OneDropsInPlay=OneDropsInPlay+CastableOneDrops; ManaLeft=ManaLeft-CastableOneDrops; OneDropsInHand=OneDropsInHand-CastableOneDrops;}
  248.                     CastableBolts=Math.min(BoltsInHand, ManaLeft);
  249.                     if (CastableBolts>=1) {OppLife=OppLife-CastableBolts*BoltDamage; ManaLeft=ManaLeft-CastableBolts; BoltsInHand=BoltsInHand-CastableBolts;}
  250.                 }
  251.                
  252.             } //end of a turn in which we drew a card and attacked
  253.  
  254.         } while (OppLife>0 &&Turn<=50);
  255.        
  256.         return Turn;
  257.     }//end of TurnKill
  258.  
  259. }//end of OptimalAggroGoldfishDeck
  260.  
  261. class OpeningHand {
  262.     int NumberOf1Cost;
  263.     int NumberOf2Cost;
  264.     int NumberOf3Cost;
  265.     int NumberOfBolts;
  266.     int NumberOfLands;
  267.  
  268.     void ResetHand(){
  269.         NumberOf1Cost=0;
  270.         NumberOf2Cost=0;
  271.         NumberOf3Cost=0;
  272.         NumberOfBolts=0;
  273.         NumberOfLands=0;
  274.     }
  275.            
  276.     void SetHand (int Nr1Cost, int Nr2Cost, int Nr3Cost, int NrBolts, int NrLands) {
  277.         NumberOf1Cost=Nr1Cost;
  278.         NumberOf2Cost=Nr2Cost;
  279.         NumberOf3Cost=Nr3Cost;
  280.         NumberOfBolts=NrBolts;
  281.         NumberOfLands=NrLands;
  282.     }
  283.  
  284. }//end of OpeningHand
  285.  
  286. class Deck {
  287.     int NumberOf1Cost;
  288.     int NumberOf2Cost;
  289.     int NumberOf3Cost;
  290.     int NumberOfBolts;
  291.     int NumberOfLands;
  292.  
  293.     void PrintDeckBrief () {
  294.         if(NumberOf1Cost<10) {System.out.print("0");}
  295.         System.out.print(NumberOf1Cost+" ");
  296.         if(NumberOf2Cost<10) {System.out.print("0");}
  297.         System.out.print(NumberOf2Cost+" ");
  298.         if(NumberOf3Cost<10) {System.out.print("0");}
  299.         System.out.print(NumberOf3Cost+" ");
  300.         if(NumberOfBolts<10) {System.out.print("0");}
  301.         System.out.print(NumberOfBolts+" ");
  302.         if(NumberOfLands<10) {System.out.print("0");}
  303.         System.out.print(NumberOfLands);
  304.         System.out.print(" ");
  305.     }
  306.  
  307.     void SetDeck (int Nr1Cost, int Nr2Cost, int Nr3Cost, int NrBolts, int NrLands) {
  308.         NumberOf1Cost=Nr1Cost;
  309.         NumberOf2Cost=Nr2Cost;
  310.         NumberOf3Cost=Nr3Cost;
  311.         NumberOfBolts=NrBolts;
  312.         NumberOfLands=NrLands;
  313.     }
  314.    
  315.     int NrOfCards(){
  316.         return NumberOf1Cost+NumberOf2Cost+NumberOf3Cost+NumberOfBolts+NumberOfLands;
  317.     }
  318.    
  319.     int DrawCard (){
  320.             Random generator = new Random();
  321.             int RandomIntegerBetweenOneAndDeckSize=generator.nextInt( this.NrOfCards() )+1;
  322.             int CardType=0;
  323.             int OneCostCutoff=NumberOf1Cost;
  324.             int TwoCostCutoff=OneCostCutoff+NumberOf2Cost;
  325.             int ThreeCostCutoff=TwoCostCutoff+NumberOf3Cost;
  326.             int BoltCutoff=ThreeCostCutoff+NumberOfBolts;
  327.             int LandCutoff=BoltCutoff+NumberOfLands;
  328.            
  329.             if (RandomIntegerBetweenOneAndDeckSize<=OneCostCutoff) {CardType=1; this.NumberOf1Cost--;}
  330.             if (RandomIntegerBetweenOneAndDeckSize>OneCostCutoff && RandomIntegerBetweenOneAndDeckSize<=TwoCostCutoff) {CardType=2; this.NumberOf2Cost--;}
  331.             if (RandomIntegerBetweenOneAndDeckSize>TwoCostCutoff && RandomIntegerBetweenOneAndDeckSize<=ThreeCostCutoff) {CardType=3; this.NumberOf3Cost--;}
  332.             if (RandomIntegerBetweenOneAndDeckSize>ThreeCostCutoff && RandomIntegerBetweenOneAndDeckSize<=BoltCutoff) {CardType=4; this.NumberOfBolts--;}
  333.             if (RandomIntegerBetweenOneAndDeckSize>BoltCutoff && RandomIntegerBetweenOneAndDeckSize<=LandCutoff) {CardType=5; this.NumberOfLands--;}
  334.             return CardType;
  335.     }
  336.    
  337. }//end of Deck
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement