-
Notifications
You must be signed in to change notification settings - Fork 1
Matching Game
David Silvan edited this page Feb 1, 2017
·
9 revisions
In this lesson we will learn how to make a matching game in Python using arrays of numbers and through the parsing of user input. For our game, we will create an array of 10 numbers, which are made up of 5 pairs of identical numbers (for example: 0,0,1,1,2,2,3,3,4,4). We will randomly put the numbers into the array and then have the user guess which indices of the array have the same value (for example, if the user enters 3 and 7, then we check to see if the numbers stored at the 3-index and 7-index of the array are of the same value). We will display the values at the indices guessed but will reset the values to be hidden if the numbers/indices entered are not of the same value.