I am trying to think of the solution for this problem:
Generate all possibilities for triangle between 10 dots which are positioned like this:
. . .
. . .
. . .
.
(like a keypad on regular mobile phone)
first line : 1 2 3
second line: 4 5 6
third line : 7 8 9
forth line : 0
I am using PHP. I tried to generate using the oposite logic. (get all combinations and remove all combination that are not triangles, but that is too complicated). Is anyone have any suggestion?