I have a simple memory game where the cards are number consecutively, shuffled and arranged face-down on the stage. I can test for the same card and get a positive result, I can test for different cards and get a positive result, and I can test to see if the first card flipped is larger or smaller than the second card.
What I think I want to do is flip _selectedCards[0], see if it is an even or odd integer, then flip _selectedCards[1] and check with the first. If _selectedCards[0] is odd, I would want to check that _selectedCards[1] is the card number immediately preceding _selectedCards[0]. if _selectedCards[0] is even, I would want to check that _selectedCards[1] is the next number. In other words, cards numbered 0 & 1 match, 2 & 3 match, etc...
My current if statement only checks for the same card and is as follows:
I just don't know enough code to write what I want. Thanks.Code:if (_selectedCards[0].cardNumber == _selectedCards[1].cardNumber) {


Reply With Quote


Bookmarks