1 00:00:00,540 --> 00:00:03,312 All right, let's make the start day method. 2 00:00:22,744 --> 00:00:25,365 The game will be held in a while loop. 3 00:00:25,365 --> 00:00:30,955 So let's create a variable called game running and set it equal to true. 4 00:00:32,355 --> 00:00:34,705 Let's also print out our game header. 5 00:00:37,360 --> 00:00:39,690 Feel free to get creative with this. 6 00:00:39,690 --> 00:00:44,221 I'm just going to put a memory game.Then 7 00:00:44,221 --> 00:00:49,408 create the cards by calling the set cards method 8 00:00:53,211 --> 00:00:55,570 and create the while loop using game running. 9 00:01:00,460 --> 00:01:04,280 The first thing we need to do is print out the grid for the player to see so 10 00:01:04,280 --> 00:01:04,970 they can guess. 11 00:01:09,830 --> 00:01:11,230 We can ask for their guesses. 12 00:01:11,230 --> 00:01:11,730 Next. 13 00:01:13,730 --> 00:01:14,754 Guess one. 14 00:01:17,211 --> 00:01:23,823 Check location and pass in first, 15 00:01:23,823 --> 00:01:28,611 guess two self.check, 16 00:01:28,611 --> 00:01:33,860 location pass in a second. 17 00:01:35,830 --> 00:01:38,872 Now that we have their matches, we can check them. 18 00:01:40,005 --> 00:01:44,216 If self dot check, match, 19 00:01:44,216 --> 00:01:48,250 I guess one, I guess two. 20 00:01:49,600 --> 00:01:53,090 If they match, then we need to see if the game has been one. 21 00:01:54,430 --> 00:02:01,626 If self dot check, win if so, let's let the player know they've won. 22 00:02:01,626 --> 00:02:03,592 Print. 23 00:02:03,592 --> 00:02:06,734 Congrats. 24 00:02:06,734 --> 00:02:11,120 You have guessed them all. 25 00:02:13,360 --> 00:02:17,116 And print out the grid one more time so they can see their handiwork. 26 00:02:17,116 --> 00:02:22,293 self dot create grid and then set game 27 00:02:22,293 --> 00:02:27,640 running to false since the game is over 28 00:02:31,140 --> 00:02:36,130 This will stop the while loop If they weren't a match. 29 00:02:44,529 --> 00:02:48,260 If they weren't a match, let's let the player know. 30 00:02:48,260 --> 00:02:53,118 I'm going to use input here, so the player gets a chance to see what the cards were 31 00:02:53,118 --> 00:02:55,275 before the grade is printed again. 32 00:03:08,100 --> 00:03:10,598 Finally, outside the while loop. 33 00:03:12,762 --> 00:03:13,800 One more, there we go. 34 00:03:15,320 --> 00:03:17,588 We can print out game over. 35 00:03:22,993 --> 00:03:28,007 Since this will only get run when game running has been set to false and 36 00:03:28,007 --> 00:03:29,920 the while loop has ended. 37 00:03:31,680 --> 00:03:37,090 Look at all that hard work Now let's jump 38 00:03:37,090 --> 00:03:43,130 down to the bottom and call our start game method. 39 00:03:48,370 --> 00:03:50,385 And let's finally play our game. 40 00:04:12,289 --> 00:04:15,090 Keep playing the game on your own and have fun. 41 00:04:15,090 --> 00:04:15,920 You did great work. 42 00:04:17,390 --> 00:04:21,960 Awesome job you put in a tonne of hard work in this course. 43 00:04:21,960 --> 00:04:27,320 So pat yourself on the back If you wanna take the game further, 44 00:04:27,320 --> 00:04:29,120 how would you incorporate a high score? 45 00:04:30,120 --> 00:04:34,660 What about letting the user pick their game size, 4 by 4 could be 46 00:04:34,660 --> 00:04:40,340 easy than 8 by 8 is medium difficulty and 12 by 12 is hard mode. 47 00:04:40,340 --> 00:04:41,980 Have fun and make it your own. 48 00:04:43,100 --> 00:04:46,710 Now that you have some object oriented programming knowledge, 49 00:04:46,710 --> 00:04:52,320 the best way to solidify it further is to try and create something on your own. 50 00:04:52,320 --> 00:04:55,390 Check the teachers notes for a few ideas. 51 00:04:55,390 --> 00:04:57,210 Keep up the hard work by the knees does