Running matching pairs game for PiFace Control And Display

Difficulty: easy

How to install and play the matching pairs card game for PiFace Control And Display.

Running PiFace Control And Display matching pairs game

This guide will show you how to play the matching cards game form the video above, using PiFace CAD.

  • First download the CADCards files from github by opening a Terminal and typing
    git clone https://github.com/thomasmacpherson/CADCards.git

  • Move into the newly created folder
    cd CADCards

  • Run CADCards with the command below. The number at the end of the command (in this example 6) sets how many pairs will appear, from a minimum of 2 to a current maximum of 10
    python3 CADCards.py 6

    You will see the PiFace CAD's backlight turn on and a number of cards appear as well as the text Turns: 0

    The CADCards game displayed starting on PiFace Control And Display
    The CADCards game displayed starting on PiFace Control And Display

  • The aim of the game is to match all the randomly placed pairs by using the PiFace CAD's rocker switch to move left and right and press it in to switch rows. Once the blinking cursor is over the card that you want, press the fourth button from the left to turn the card over. Then move to the card you think is a match for this one and press the fourth button again. If they match, they will be removed from the game, otherwise they will turn back over.

    Two cards turned over on the matching pairs game
    Two cards turned over on the matching pairs game

    Matching pairs game halfway through the game
    Matching pairs game halfway through the game

  • When the game is over your score will be displayed and compared to the previous best score from the CADCardsHighScores file, for the number of cards you played with. If you beat the best score, it will be replaced with your new score for you to try and beat next time.

  • To reset your high scores, open the CADCardsHighScores file with your favourite text editor
    leafpad CADCardsHighScores

    You will see a list of numbers, these are the high scores with the first one being for a 2 card game. Change these number to a high number like 100 and save the file.