Nuticulus
August 11th, 2009, 09:41 AM
Hi,
I have a "row" class with members pixels[200], int numPixels, and int offset, and an "order" class with members int ord[100] and int off[100].
I also have 2 arrays of rows, row Good1[height] and row Unscrambled[height], of which only the first NumGood1 (int) elements are defined.
Also there is an order object o, where ord[] and off[] are only defined from 0 to NumGood1 inclusive.
I need an algorithm that:
Only changes the values of Unscrambled[]
Tries to copy elements from Good1[] into Unscrambled[] so that Unscrambled[x].numPixels == o.ord[x] and Unscrambled[x].offset == o.off[x]
Will, if called repeatedly, cycle through all possible solutions.
Thankyou very much. I have been racking my brains out on this, so I hope someone is cleverer than I am. ;)
I have a "row" class with members pixels[200], int numPixels, and int offset, and an "order" class with members int ord[100] and int off[100].
I also have 2 arrays of rows, row Good1[height] and row Unscrambled[height], of which only the first NumGood1 (int) elements are defined.
Also there is an order object o, where ord[] and off[] are only defined from 0 to NumGood1 inclusive.
I need an algorithm that:
Only changes the values of Unscrambled[]
Tries to copy elements from Good1[] into Unscrambled[] so that Unscrambled[x].numPixels == o.ord[x] and Unscrambled[x].offset == o.off[x]
Will, if called repeatedly, cycle through all possible solutions.
Thankyou very much. I have been racking my brains out on this, so I hope someone is cleverer than I am. ;)