1 00:00:00,000 --> 00:00:04,964 [MUSIC] 2 00:00:04,964 --> 00:00:06,880 Hi there, Pythonistas. 3 00:00:06,880 --> 00:00:10,153 Now that you have some OOP knowledge under your belt, 4 00:00:10,153 --> 00:00:12,125 it's time to put it to the test. 5 00:00:12,125 --> 00:00:15,282 [SOUND] We're going to make a memory game. 6 00:00:15,282 --> 00:00:20,154 This is the same game you may remember from childhood, where you have 7 00:00:20,154 --> 00:00:25,730 a set of cards face down, and you flip two over to see if they match. 8 00:00:25,730 --> 00:00:29,730 If they don't, you flip them back over and try again. 9 00:00:29,730 --> 00:00:34,500 If they do match, then they stay face up until you've matched all the cards. 10 00:00:35,770 --> 00:00:38,250 Let's open up Workspaces and check this out. 11 00:00:40,760 --> 00:00:46,780 Here we have two files, cards.py and game.py. 12 00:00:46,780 --> 00:00:51,300 Our game will have two classes, a card class in cards.py, and 13 00:00:51,300 --> 00:00:53,940 a game class in game.py. 14 00:00:53,940 --> 00:00:58,570 The memory game has a set of cards placed into a grid. 15 00:00:58,570 --> 00:01:02,980 Let's look at what the final product will look like. 16 00:01:02,980 --> 00:01:08,290 Here we can see the grid, and it's asking us for our first location. 17 00:01:08,290 --> 00:01:10,432 We'll need column and row headers so 18 00:01:10,432 --> 00:01:13,410 the player can give us the location of their guess. 19 00:01:16,901 --> 00:01:22,430 Inside of the grid will be a set of cards, but they are hidden when the game starts. 20 00:01:22,430 --> 00:01:27,035 The player will need to give us two locations, and if they don't match, 21 00:01:27,035 --> 00:01:31,051 we'll need to let the player know and then have them try again. 22 00:01:39,255 --> 00:01:44,640 If the cards do match, the grid needs to update to show the matched cards. 23 00:01:47,903 --> 00:01:51,560 When all the cards have been matched, the game ends. 24 00:01:51,560 --> 00:01:52,330 Let's get to it.