game memory match logic