in reply to Solver for the game "Set" matches three times
I personally would try to keep track of the unique combinations of the cards using a hash, the keys being the card
sorted contactenated shape/color/pattern values of the cards.
so if I have 2 cards 2,3,1,2 and 1,2,3,1 first create two keys,
2312 and 1231, sort them 1231,2312, concat them as a key ++$unique_combo{"12312312"};
After been over all the cards the keys in my hash will be the unique combinations.
Further, @{$combo->[0]} should just dereference your array
GreetZ!,
print "profeth still\n" if /bird|devil/;
sorted contactenated shape/color/pattern values of the cards.
so if I have 2 cards 2,3,1,2 and 1,2,3,1 first create two keys,
2312 and 1231, sort them 1231,2312, concat them as a key ++$unique_combo{"12312312"};
After been over all the cards the keys in my hash will be the unique combinations.
Further, @{$combo->[0]} should just dereference your array
GreetZ!,
- ChOas
print "profeth still\n" if /bird|devil/;
|
---|
In Section
Seekers of Perl Wisdom