Skip to content

Possible loops created due to last row step 4 #1

Description

@JagKing

On the last row step 4 is still run to remove bottom walls. Due to this removing counts from the relevant set id in numberInSet, mergeSets will not completely merge all of the sets. This is in turn due to the if (numberInSet[rightSetID] == 0) check short circuiting the for loop when the number of sets hits 0, even though there may actually still be some cells with that set id.

To replicate this, set the maze size to something small, say 12 x 12 and run the maze a few times. It doesn't take too many runs to get a loop to appear.

An example of a produced loop:
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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