예제 #1
0
 public static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=7476.msg212934#msg212934
     testOutput.ComparePlayers("DuchyDukeWarehouseEmbassy", "BigMoney");
     testOutput.ComparePlayers("FeodumDevelop", "BigMoney");
     testOutput.ComparePlayers("DuchyDukeWarehouseEmbassy", "FeodumDevelop");
 }
예제 #2
0
 static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=6281.0
     testOutput.ComparePlayers("Rebuild", "BigMoney");
     //testOutput.ComparePlayers(Strategies.BigMoneyWithCard<CardTypes.Catacombs>.Player(1, 2), Strategies.BigMoney.Player(2));
     //testOutput.ComparePlayers(Strategies.BigMoneyWithCard<CardTypes.Count>.Player(1), Strategies.BigMoney.Player(2));
     testOutput.ComparePlayers(Strategies.BigMoneyWithCard.Player(Cards.HuntingGrounds), Strategies.BigMoney.Player());
 }
예제 #3
0
        public static void Run(TestOutput testOutput)
        {
            var rebuildStrategy = Strategies.Rebuild.Player();

            // for forum topic: http://forum.dominionstrategy.com/index.php?topic=8391.0
            testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoney.Player());
            testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.Wharf, cardCount: 2));
            testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.Mountebank, cardCount: 2));
            testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2));
            testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.YoungWitch, cardCount: 2));
        }
예제 #4
0
        private static void ComparePlayers(int gameCount, CardCountPair[] startingCards, TestOutput testOutput)
        {
            var gameLogFactory = new GameLogFactory();

            var player1 = Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2);
            var player2 = Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2);

            var builder = new GameConfigBuilder();

            builder.SetKingdomCards(player1, player2);
            if (startingCards != null)
            {
                builder.SetStartingDeck(startingCards);
            }

            var gameConfig = builder.ToGameConfig();

            testOutput.ComparePlayers(
                Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2),
                Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2),
                gameConfig,
                rotateWhoStartsFirst: true,
                numberOfGames: gameCount,
                createGameLog: new Dominion.Data.CreateGameLog(gameLogFactory.CreateGameLog));

            System.Console.WriteLine("Curses Split was Uneven {0}%", gameLogFactory.UnEvenSplitPercent);
            System.Console.WriteLine();
            System.Console.WriteLine("When the curses were not split, Player 1 won the curse split {0}/{1}", gameLogFactory.Player1WinPercent, gameLogFactory.Player2WinPercent);
        }
예제 #5
0
        static void Main()
        {
            using (var testOutput = new TestOutput())
            {
                StrategyDescription descr1 = StrategyDescription.GetDefaultStrategyDescription().AddCardToPurchaseOrder(Cards.YoungWitch).AddCardToPurchaseOrder(Cards.Sage);
                StrategyDescription descr2 = StrategyDescription.GetDefaultStrategyDescription().AddCardToPurchaseOrder(Cards.SeaHag).AddCardToPurchaseOrder(Cards.Sage);

                //var player1 = Strategies.BigMoneyWithCard.Player(Cards.TreasureTrove, cardCount:10);
                //var player2 = Strategies.BigMoneyWithCard.Player(Cards.Gold);

                var player1 = descr1.ToPlayerAction("young witch");
                var player2 = descr2.ToPlayerAction("sea hag");

                var builder = new GameConfigBuilder();
                builder.SetBaneCard(Cards.Sage);
                builder.CardSplit = StartingCardSplit.Split43;
                builder.SetKingdomCards(player1, player2);

                testOutput.ComparePlayers(
                    player1,
                    player2,
                    builder.ToGameConfig(),
                    rotateWhoStartsFirst: true,
                    createHtmlReport: true,
                    numberOfGames: 1000,
                    shouldParallel: false);
            }
        }
예제 #6
0
        static void Main(string[] args)
        {
            using (var testOutput = new TestOutput())
            {
                var playerAction = Strategies.BigMoneyWithCard.Player(Cards.Magpie, cardCount: 2, playerName: "DoubleMagpie");
                foreach (PlayerAction otherPlayerAction in BuiltInStrategies.StrategyLoader.GetAllPlayerActions())
                {
                    if (playerAction == otherPlayerAction)
                    {
                        continue;
                    }

                    testOutput.ComparePlayers(
                        playerAction,
                        otherPlayerAction,
                        shouldParallel: true,
                        logGameCount: 0,
                        debugLogs: false,
                        numberOfGames: 1000,
                        useColonyAndPlatinum: true,
                        createHtmlReport: false,
                        createRankingReport: true);
                }
            }
        }
 static void Run(TestOutput testOutput)
 {
     // goal is to find a strategy that always beats big money.  Haven't found it yet.
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=8580.0
     //ComparePlayers(Strategies.FishingVillageChapelPoorHouseTalisman.Player(1), Strategies.BigMoney.Player(2));
     //ComparePlayers(Strategies.FishingVillageChapelPoorHouse.Player(1), Strategies.BigMoney.Player(2));
     testOutput.ComparePlayers("GardensBeggarIronworks", "BigMoney", numberOfGames: 10000);
 }
예제 #8
0
 public static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=6623.0
     System.Console.WriteLine("Followers Cost, Player 1 Win %, Player 2 Win%, Tie%");
     for (int i = 0; i < 16; ++i)
     {
         System.Console.Write("{0}, ", i);
         testOutput.ComparePlayers(Strategies.FollowersTest.TestPlayer(i), Strategies.BigMoney.Player(), showCompactScore: true);
     }
 }
예제 #9
0
        static void EvaulateBestStrategyForFirstGame(TestOutput testOutput)
        {
            //FindBestStrategy currently finds the following, which is better than BigMoneySimple, but not as good as BigMoney
            //Province(1), Province, Gold, Market(1), Duchy(2), Militia(2), Silver, Estate(1),Workshop(1), Cellar(1),
            var player1 = new PlayerAction("Player 1",
                                           new CardPickByPriority(
                                               CardAcceptance.For(Cards.Province),
                                               CardAcceptance.For(Cards.Gold),
                                               CardAcceptance.For(Cards.Market, gameState => Strategy.CountAllOwned(Cards.Market, gameState) < 1),
                                               CardAcceptance.For(Cards.Duchy, gameState => Strategy.CountAllOwned(Cards.Duchy, gameState) < 2),
                                               CardAcceptance.For(Cards.Militia, gameState => Strategy.CountAllOwned(Cards.Militia, gameState) < 2),
                                               CardAcceptance.For(Cards.Silver),
                                               CardAcceptance.For(Cards.Estate, gameState => Strategy.CountAllOwned(Cards.Militia, gameState) < 1)
                                               ));

            testOutput.ComparePlayers(player1, Strategies.BigMoneySimple.Player(), showVerboseScore: true);
            testOutput.ComparePlayers(player1, Strategies.BigMoney.Player(), showVerboseScore: true);
            testOutput.ComparePlayers(player1, Strategies.BigMoneySingleSmithy.Player(), showVerboseScore: true);
        }
예제 #10
0
        static void FindOptimalPlayForEachCardWithBigMoney()
        {
            PlayerAction bigMoneyPlayer = Strategies.BigMoney.Player();

            using (var htmlRender = new HtmlRenderer.DeferredHtmlGenerator())
                using (var testoutput = new TestOutput())
                {
                    foreach (Card card in Dominion.Strategy.MissingDefaults.FullyImplementedKingdomCards())
                    {
                        var playerAction = StrategyOptimizer.FindBestBigMoneyWithCardVsStrategy(bigMoneyPlayer, card, logProgress: false);
                        var results      = Dominion.Data.StrategyComparison.Compare(playerAction, bigMoneyPlayer, shouldParalell: true);
                        htmlRender.AddResults(results, TestOutput.GetOutputFilename);

                        System.Console.WriteLine("Before Optimization");
                        testoutput.ComparePlayers(Strategies.BigMoneyWithCard.Player(card), bigMoneyPlayer, createHtmlReport: false);
                        System.Console.WriteLine("After Optimization");
                        testoutput.ComparePlayers(playerAction, bigMoneyPlayer, createHtmlReport: false);
                    }
                }
        }
예제 #11
0
 static void Main(string[] args)
 {
     using (var testOutput = new TestOutput())
     {
         var bigMoneyPlayer = Strategies.GardensWorkshop.Player();
         foreach (PlayerAction playerAction in AllBigMoneyWithCard())
         {
             testOutput.ComparePlayers(bigMoneyPlayer, playerAction, numberOfGames: 1000, shouldParallel: true, createHtmlReport: false, createRankingReport: true, logGameCount: 0);
         }
     }
 }
예제 #12
0
        public static void Run(TestOutput testOutput)
        {
            GameConfig gameConfig = GameConfigBuilder.Create(
                StartingCardSplit.Split43,
                Cards.Bishop,
                Cards.FarmingVillage,
                Cards.GrandMarket,
                Cards.Hamlet,
                Cards.Hoard,
                Cards.Monument,
                Cards.Mountebank,
                Cards.PhilosophersStone,
                Cards.ScryingPool,
                Cards.Vineyard
                );

            testOutput.ComparePlayers(Strategies.MountebankMonumentHamletVineyard.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.MountebankHoard.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.MountebankMonumentHamletVineyard.Player(), Strategies.MountebankHoard.Player(), gameConfig);
        }
예제 #13
0
        // forum post:  http://forum.dominionstrategy.com/index.php?topic=9602.0

        /*  any attempt to get more than one remake, or more than 2 sooth sayers results in a loss ....  (but in real game, the plan was 3 remakes and 3 soothsayers ...)
         *
         *
         * */

        public static void Run(TestOutput testOutput)
        {
            GameConfig gameConfig = GameConfigBuilder.Create(
                StartingCardSplit.Split43,
                Cards.Butcher,
                Cards.GreatHall,
                Cards.HornOfPlenty,
                Cards.HorseTraders,
                Cards.Minion,
                Cards.Pawn,
                Cards.Remake,
                Cards.Soothsayer,
                Cards.StoneMason,
                Cards.Swindler
                );

            //testOutput.ComparePlayers(Strategies.HorseTraderSoothsayerMinionGreatHall.Player(1), Strategies.HorseTraderSoothsayerMinionGreatHall.Player(2, false), gameConfig);
            testOutput.ComparePlayers(Strategies.HorseTraderSoothsayerMinionGreatHall.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.RemakeSoothsayer.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.RemakeSoothsayer.Player(), Strategies.HorseTraderSoothsayerMinionGreatHall.Player(), gameConfig);
        }
예제 #14
0
        public static void Run(TestOutput testOutput)
        {
            testOutput.ComparePlayers(Strategies.BigMoney.Player(), Strategies.BigMoneyFishingVillageOverSilver.Player(2));
            testOutput.ComparePlayers(Strategies.BigMoney.Player(), Strategies.BigMoneyFishingVillageAvailableForDeckCycle.Player(2));
            testOutput.ComparePlayers(Strategies.BigMoney.Player(), Strategies.BigMoneyFishingVillageEmptyDuration.Player(2));
            testOutput.ComparePlayers(Strategies.BigMoneyFishingVillageAvailableForDeckCycle.Player(1), Strategies.BigMoneyFishingVillageEmptyDuration.Player(2));

            testOutput.ComparePlayers(Strategies.BigMoneyDoubleJack.Player(), Strategies.BigMoney.Player());
            testOutput.ComparePlayers(Strategies.BigMoneyWithSilverReplacement.Player(Cards.FishingVillage, "BigMoneyWithFishingDoubleJack", Cards.JackOfAllTrades, count: 2), Strategies.BigMoney.Player());
            testOutput.ComparePlayers(Strategies.BigMoneyDoubleJack.Player(), Strategies.BigMoneyWithSilverReplacement.Player(Cards.FishingVillage, "BigMoneyWithFishingDoubleJack", Cards.JackOfAllTrades, count: 2));
        }
예제 #15
0
        static void Main()
        {
            using (var testOutput = new TestOutput())
            {
                var player1 = Strategies.GardensCounterPlay.Player(Cards.Monument);
                var player2 = Strategies.GardensWorkshop.Player();

                var builder = new GameConfigBuilder();
                builder.CardSplit = StartingCardSplit.Split43;
                builder.SetKingdomCards(player1, player2);

                testOutput.ComparePlayers(
                    new PlayerAction[] { player1, player2 },
                    builder.ToGameConfig(),
                    rotateWhoStartsFirst: true,
                    createHtmlReport: true,
                    numberOfGames: 1000,
                    shouldParallel: false);
            }
        }
예제 #16
0
        static void Main()
        {
            using (var testOutput = new TestOutput())
            {
                var player1 = Strategies.BigMoneyWithCard.Player(Cards.Amulet, cardCount: 1);
                var player2 = Strategies.BigMoneyWithCard.Player(Cards.Gold);

                var builder = new GameConfigBuilder();
                builder.CardSplit = StartingCardSplit.Split43;

                PlayerAction.SetKingdomCards(builder, player1, player2);
                testOutput.ComparePlayers(
                    player1,
                    player2,
                    builder.ToGameConfig(),
                    rotateWhoStartsFirst: true,
                    createHtmlReport: true,
                    numberOfGames: 1000,
                    shouldParallel: false);
            }
        }
예제 #17
0
 public static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=8461.0
     testOutput.ComparePlayers(Strategies.BigMoneyWithCard.Player(Cards.Soothsayer), Strategies.BigMoneyWithCard.Player(Cards.Witch));
 }
 public static void Run(TestOutput testOutput)
 {
     testOutput.ComparePlayers("RebuildAdvanced", "RebuildAdvanced", startingDeckPerPlayer: StartingDecksForRebuildWithEstateAdvantage.StartingDecks);
 }