示例#1
0
        static void Main(string[] args)
        {
            const int n   = 4; // number of images on a card
            const int rep = 4; // number of repeters of an image

            var cards = new CardsGenerator().Generate(n, rep);
        }
示例#2
0
        public void AllCardsConnectWithEachOver()
        {
            const int width = 1 + (rep - 1)*n;
            var cards = new CardsGenerator().Generate(n, rep);
            ShowCards(cards);

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    for (int i1 = 0; i1 < width; i1++)
                    {
                        bool isConnect = false;
                        for (int j1 = 0; j1 < n; j1++)
                        {
                            if (cards[j, i] == cards[j1, i1])
                            {
                                isConnect = true;
                                break;
                            }
                        }

                        Assert.IsTrue(isConnect);
                    }
                }
            }
        }
示例#3
0
文件: Program.cs 项目: ne4ta/dobble
        static void Main(string[] args)
        {
            const int n = 4; // number of images on a card
            const int rep = 4; // number of repeters of an image

            var cards = new CardsGenerator().Generate(n, rep);
        }