1 00:00:00,000 --> 00:00:00,650 2 00:00:00,650 --> 00:00:04,330 >> Now that you've initialized the board, and that you've drawn it, it's time to 3 00:00:04,330 --> 00:00:07,970 let the user edit it and make their moves. 4 00:00:07,970 --> 00:00:13,380 So in that 15.c function, the program takes input from the user and then 5 00:00:13,380 --> 00:00:17,390 calls the move function, passing in the number of the tile that the user 6 00:00:17,390 --> 00:00:18,650 wants to move. 7 00:00:18,650 --> 00:00:19,770 Now be careful. 8 00:00:19,770 --> 00:00:23,570 This is the actual number of the tile and not its actual position. 9 00:00:23,570 --> 00:00:28,380 So you'll need to search for the tile's position to know where it is. 10 00:00:28,380 --> 00:00:32,800 >> Now, you should only allow the user to make a move if it's legal. 11 00:00:32,800 --> 00:00:37,280 A legal move is any tile that is adjacent to the blank tile. 12 00:00:37,280 --> 00:00:41,390 That means above and below, to the left and to the right. 13 00:00:41,390 --> 00:00:44,050 So you'll need to know where the blank tile is as well. 14 00:00:44,050 --> 00:00:47,400 >> Now, for every move, you're searching for the user's tile. 15 00:00:47,400 --> 00:00:51,560 But it's probably not best to search for the blank tile every time, because 16 00:00:51,560 --> 00:00:54,640 you're doing it every single time the user wants to move. 17 00:00:54,640 --> 00:00:59,670 So instead, it's best to remember where the blank tile is, using some 18 00:00:59,670 --> 00:01:02,030 well named variables. 19 00:01:02,030 --> 00:01:05,340 So once you allow the user to make their moves, they are well on their 20 00:01:05,340 --> 00:01:07,580 way to winning the game of 15. 21 00:01:07,580 --> 00:01:08,830