Last active
August 29, 2015 13:57
-
-
Save AnhNhan/9820226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The column struct, with the array | |
struct Column | |
{ | |
State[] states; | |
private bool[State] _uniques; | |
bool add(ref State state) | |
{ | |
if (state in _uniques) | |
{ | |
return false; | |
} | |
state.end_column = &this; | |
_uniques[state] = true; | |
states ~= state; | |
return true; | |
} | |
} | |
// The iteration | |
foreach (state; col.states) | |
{ | |
// ... | |
col.add(State(...)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment