Warning: Large values (16+) have a probably will cause your browser to display a "Script Execution Time" error. ... for those of you still brave enough... type in values to calculate the number of unique tables: W(,)
In an attempt to organize my own thoughts, I am making a high level outline with some pseudocode.
Class Row
Row->cracks = integer (used as a bit array of crack positions, see source code comments for more details)
Row->width = integer width
Row->findTables(allRows, tableHeight, count) = returns an int for the number of possible tables that can be created from an array of possible Row objects allRows, and a size tableHeight, starting from int count. It's fully recursive.
Row->matchesBelow(row) does binary operation on cracks property to determine if they are a match or not.
main()
1. Generate All Possible Row Objects
2. Foreach Row Object, find all its possible matches (Optional. See Below)
3. Foreach Row Object, call findTables method to find every unique path / table
4. Return totalCount
You can reach me on AIM, s/n = dizdique or gchat = dizdique@gmail.com