コード例 #1
0
        public void HorizontalBingo()
        {
            BingoCard card = new BingoCard();

            for (int row = 0; row < BingoCard.MaxColumns - 1; row++)
            {
                Assert.IsFalse(card.Mark(card.GetCard()[row, 0].Number));
            }
            Assert.IsTrue(card.Mark(card.GetCard()[BingoCard.MaxRows - 1, 0].Number));
        }
コード例 #2
0
        public void TopRightDiagonalBingo()
        {
            BingoCard card = new BingoCard();

            for (int n = 0; n < BingoCard.MaxColumns - 1; n++)
            {
                Assert.IsFalse(card.Mark(card.GetCard()[n, BingoCard.MaxColumns - n - 1].Number));
            }
            Assert.IsTrue(card.Mark(card.GetCard()[BingoCard.MaxRows - 1, 0].Number));
        }
コード例 #3
0
        public void VerticalBingo()
        {
            BingoCard card = new BingoCard();

            for (int column = 0; column < BingoCard.MaxColumns - 1; column++)
            {
                Assert.IsFalse(card.Mark(card.GetCard()[0, column].Number));
            }
            Assert.IsTrue(card.Mark(card.GetCard()[0, BingoCard.MaxColumns - 1].Number));
        }
コード例 #4
0
    private static void Main(string[] args)
    {
        var a = ReadIntsLinesAsList(3);
        var n = ReadInt();
        var b = ReadIntLinesAsList(n);

        var card = new BingoCard(a);

        b.ForEach((number) => card.Mark(number));

        var answer = (card.HasBingo()) ? "Yes" : "No";

        Console.WriteLine(answer);
    }