Skip to content

Non square puzzles sometimes crashes with an IndexOutOfRangeException #3

@sonnemaf

Description

@sonnemaf

If the puzzle is not square it sometimes crashes with an IndexOutOfRangeException.

Try this.

[Test]
public void CreateAndSolve()
{
    var pd = new WordSearchBuilder(20, 10)
    .WithWords("word1", "word2", "word3")
    .Build();

    var sol = new StandardWordSearchSolver();

    foreach (var word in pd.Solution)
    {
        var result = sol.SeekWord(pd.Puzzle, word.Word);
        result.First().Should().BeEquivalentTo(word);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions