Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
Gold Member
Dearly Missed
- 35,003
- 21,715
pioneerboy said:y, I can't contribute to the solution as such else than an algorithm might be best built up upon the declaration of the 4 dogs as letters A, B, C, and D and the differentiation of heads and tails into small and large letters (a, b, c, d, A, B, C, D), whereas on a card heads and tails are always opposite of each other and two neighbouring cards would result in a whole dog of the form of e.g. a¦A.
I used numbers {1,2,3,4} for heads and {-1,-2,-3,-4} for tails instead. That makes matching cells much easier. I used if(one_cell == -the_other_cell) but I could have obfuscated it with something like if(!(one_cell+the_other_cell)) for a more C-ish look.