galenscovell / Circuits

Circuit connecting puzzle game for Android
0 stars 0 forks source link

Implement win conditions #4

Closed galenscovell closed 9 years ago

galenscovell commented 9 years ago

Win occurs when all nodes are combined into single set. Checker may utilize disjoint sets and union find for efficiency.

galenscovell commented 9 years ago

Implemented. Win condition is actually that every node within the level is full (to its specified capacity). Originally I thought I would have to use a disjoint set to check that all of the nodes are also connected into a single component, but looking at the how the majority of Hashi puzzles work, this is unnecessary; though the win conditions are that all nodes are in one set and all nodes are full, the puzzles ought to be impossible to solve without getting all nodes full to begin with, therefore the connectedness check may be unneeded.

THAT SAID, it may be a good idea to implement the disjoint set connectedness as a failsafe anyway. We'll see how it goes.