Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Solver for the game "Set" matches three times

by ChOas (Curate)
on Jul 15, 2008 at 06:09 UTC ( #697643=note: print w/replies, xml ) Need Help??


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!,
    ChOas

print "profeth still\n" if /bird|devil/;
  • Comment on Re: Solver for the game "Set" matches three times

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://697643]
help
Chatterbox?
[Eily]: that was a sneeze overpowering a cough
[choroba]: Czechs sneeze "Hep-cheek"
vrk adds gingerbread cookies to the platter on the sideboard.
[erix]: I'll give that a try next time
vrk takes a cookie from the platter on the sideboard.
[Eily]: French sneeze "Atchoum", because we close our mouth when we're done :P
[erix]: Hatshepsut (no sneezing audio there)
choroba wipes the saliva from the cookies
[LanX]: scary Le Pen + Melonchon had over 40% ...
[vrk]: One good word for it in Finnish is pärskäys. A very wet connotation.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2017-04-24 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.