DISCLAIMER: This is for a project euler problem, number 68.
Hello all. I have a certain issue, which isn't exactly C-specific, but I was hoping for some advice.
My goal is to generate ordered sets of 5 triples, such that they can be interpreted as a possible solution to the "5-gon" problem seen at the following link.
https://projecteuler.net/problem=68.
An example would be:
Code:
{(1,2,3), (4,3,5), (6,5,7), (8,7,9), (10,9,2)}
Now this example is not a solution to the problem, but it does show some of the rules I need to employ in generating these sets. One rule is that for every triple, the last number in the triple must be the second number in the next triple (with wrapping from 5 to 1). Also some numbers must not be repeated.
I know there exist tools that do things like this for the purpose of password cracking. I haven't found one that does quite what I need however.
Does anyone know of any tool that would solve this problem? If not, does anyone have any advice on how to implement something like this? I know that at the very least I could use many for loops with a list of already used numbers to prevent unwanted number reuse, but I'm hoping to find something better (more efficient) than this.