I would make a program to calculate a sequence, taken from a game i played.
Basically you have a sequence of numbers, it is like a clock really, meaning they're disposed in a circle. These numbers are 1 digits only, from 1 to a max of 6, but there can be duplicates of numbers along the circle, meaning the sequence can be for example 2, 2, 3, 2, 2 (starting from top/north position and following the circumference clockwise).
The purpose of this kind of game is "selecting" ALL the numbers in the sequence but selecting them all just ONCE. You can choose where to start from. When you select a number, you can choose next only the two other numbers distancing by the number you selected. By two numbers I mean you can choose distancing forward or backwards. For examples, you select a 3, you can next select only the two numbers which have a distance of 3 from the 3. So, in the example case, the selectable values would both be 2, but in different positions. If per chance one of the two positions is unselectable, since you already selected it earlier, you cannot select it again, you can only select the others. If both are unavailable, you lose (as you indeed failed to create a sequence of selecting all numbers not selecting the same multiple times).
In the example case that I could sample like this:
2
2
3
2
2
the solution could be this (there is more than one solution in this example but this is one possible solution)
2 1st select
2 4th select
3 2nd select
2 5th select
2 3rd select
As you see, after the 3 you move backwards and so you choose the last in the list as 3rd selection. Then you move forward again restarting from the top of the list.
So, my goal would be to create a program which calculates a possible solution for this game, given a starting sequence of values. Only, the list of values can be up to 13 values. I thought also about calculating permutations but it would be 13 factorial... Once the solution is found, i need to write (messagebox, textbox, label, whatever you want) the sequence of the numbers selected and the positions in the original list (as there can be duplicate values so I need to know exactly what position that number is). How would you advice to handle this thing?
Basically you have a sequence of numbers, it is like a clock really, meaning they're disposed in a circle. These numbers are 1 digits only, from 1 to a max of 6, but there can be duplicates of numbers along the circle, meaning the sequence can be for example 2, 2, 3, 2, 2 (starting from top/north position and following the circumference clockwise).
The purpose of this kind of game is "selecting" ALL the numbers in the sequence but selecting them all just ONCE. You can choose where to start from. When you select a number, you can choose next only the two other numbers distancing by the number you selected. By two numbers I mean you can choose distancing forward or backwards. For examples, you select a 3, you can next select only the two numbers which have a distance of 3 from the 3. So, in the example case, the selectable values would both be 2, but in different positions. If per chance one of the two positions is unselectable, since you already selected it earlier, you cannot select it again, you can only select the others. If both are unavailable, you lose (as you indeed failed to create a sequence of selecting all numbers not selecting the same multiple times).
In the example case that I could sample like this:
2
2
3
2
2
the solution could be this (there is more than one solution in this example but this is one possible solution)
2 1st select
2 4th select
3 2nd select
2 5th select
2 3rd select
As you see, after the 3 you move backwards and so you choose the last in the list as 3rd selection. Then you move forward again restarting from the top of the list.
So, my goal would be to create a program which calculates a possible solution for this game, given a starting sequence of values. Only, the list of values can be up to 13 values. I thought also about calculating permutations but it would be 13 factorial... Once the solution is found, i need to write (messagebox, textbox, label, whatever you want) the sequence of the numbers selected and the positions in the original list (as there can be duplicate values so I need to know exactly what position that number is). How would you advice to handle this thing?
Last edited: