Annotate() public static method

public static Annotate ( Array, input ) : string[]
input Array,
return string[]
Esempio n. 1
0
    public void Vertical_line_mines_at_edges()
    {
        var input = new string[]
        {
            "*",
            " ",
            " ",
            " ",
            "*"
        };
        var expected = new string[]
        {
            "*",
            "1",
            " ",
            "1",
            "*"
        };

        Assert.Equal(expected, Minesweeper.Annotate(input));
    }
Esempio n. 2
0
    public void Cross()
    {
        var minefield = new[]
        {
            "  *  ",
            "  *  ",
            "*****",
            "  *  ",
            "  *  "
        };
        var expected = new[]
        {
            " 2*2 ",
            "25*52",
            "*****",
            "25*52",
            " 2*2 "
        };

        Assert.Equal(expected, Minesweeper.Annotate(minefield));
    }
Esempio n. 3
0
    public void Vertical_line_mines_at_edges()
    {
        var minefield = new[]
        {
            "*",
            " ",
            " ",
            " ",
            "*"
        };
        var expected = new[]
        {
            "*",
            "1",
            " ",
            "1",
            "*"
        };

        Assert.Equal(expected, Minesweeper.Annotate(minefield));
    }
Esempio n. 4
0
    public void Vertical_line()
    {
        var input = FormatInput(new[]
        {
            " ",
            "*",
            " ",
            "*",
            " "
        });

        var expected = FormatInput(new[]
        {
            "1",
            "*",
            "2",
            "*",
            "1"
        });

        Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected));
    }
Esempio n. 5
0
    public void Cross()
    {
        var input = FormatInput(new[]
        {
            "  *  ",
            "  *  ",
            "*****",
            "  *  ",
            "  *  "
        });

        var expected = FormatInput(new[]
        {
            " 2*2 ",
            "25*52",
            "*****",
            "25*52",
            " 2*2 "
        });

        Assert.That(Minesweeper.Annotate(input), Is.EqualTo(expected));
    }
Esempio n. 6
0
    public void Large_minefield()
    {
        var minefield = new[]
        {
            " *  * ",
            "  *   ",
            "    * ",
            "   * *",
            " *  * ",
            "      "
        };
        var expected = new[]
        {
            "1*22*1",
            "12*322",
            " 123*2",
            "112*4*",
            "1*22*2",
            "111111"
        };

        Assert.Equal(expected, Minesweeper.Annotate(minefield));
    }
    public void Large_board()
    {
        var input = new string[]
        {
            " *  * ",
            "  *   ",
            "    * ",
            "   * *",
            " *  * ",
            "      "
        };
        var expected = new string[]
        {
            "1*22*1",
            "12*322",
            " 123*2",
            "112*4*",
            "1*22*2",
            "111111"
        };

        Assert.Equal(expected, Minesweeper.Annotate(input));
    }