Quantcast
Channel: VBForums - Maths Forum
Viewing all articles
Browse latest Browse all 118

I would like to find all possible combinations of a 2D array.

$
0
0
I have a 8x8 array, where each slot can be on or off. It's basically a small monochrome image. I would like to create a loop, that allows me to list all possible combinations of pixels. This is 8x8 so it fits perfectly into a 64 bit Int64, where I set a bit on or off. I don't have a problem setting it or converting it.

So the second instance would be

0000...1 <- 64 digits in binary and in hexadecimal it is 0000000000000001 <- 16 digits. basically I would like all combinations, so I would have a huge list of hexadecimal numbers from 0 to FFFFFFFFFFFFFFFF.

What would be the best way to do this. I will eventually search that list for duplicates that have different rotations or flips for example

******** *****+++
******** *****+*+
******** *****+++
******** ********
******** ********
*****+++ ********
*****+*+ ********
*****+++ ********

These correspond to hex 0000000000070507 and hex 0705070000000000, which sequentially are different but the pattern can be eliminated because of the mirror up function.

The functions I will have are mirror up down, mirror left right and rotate 90 degrees 180 degrees and 270 degrees in both directions.

I'm trying to wrap my head around how an algorithm would work with this basic set of data, so I can eliminate duplicates as necessary. After apply it to the entire range of possibilities, I want to make my function applicable to just a range.

Ok, I think I said enough. Is there a good way to do this? or is there a math example that identifies this type of problem? I thought it might be fundamental but I have not done something like this.

Viewing all articles
Browse latest Browse all 118

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>