1 00:00:06,050 --> 00:00:12,050 In the last video I used template blending to pretty quickly come up with 2 00:00:12,050 --> 00:00:17,390 the solve function. What I didn't do in that video was to 3 00:00:17,390 --> 00:00:20,423 write out the two wish list entries for the function we came up with. 4 00:00:20,423 --> 00:00:25,760 And that's what I'm going to do now. We ended up right here, and the two 5 00:00:25,760 --> 00:00:34,010 functions that we wished for but didn't define are solved and next boards. 6 00:00:34,010 --> 00:00:37,480 So let's go ahead and do wish list entries for those. 7 00:00:37,480 --> 00:00:43,420 Let's see. Solved, we give it a board, and we 8 00:00:43,420 --> 00:00:45,872 want to know, is this board a final solution. 9 00:00:45,872 --> 00:00:49,990 That's a yes. No question. 10 00:00:49,990 --> 00:01:00,933 So it's going to produce a Boolean and it's produce true if board is solved. 11 00:01:00,933 --> 00:01:06,150 Now what does solved mean? Well the way we generate the tree we only 12 00:01:06,150 --> 00:01:10,630 put into the tree valid boards. So actually if we have a board that's 13 00:01:10,630 --> 00:01:13,280 full. If we have a board that has no empty 14 00:01:13,280 --> 00:01:24,276 space in it, then it's solved. So we could just note, assume board is 15 00:01:24,276 --> 00:01:41,137 valid, so it is solved if it is full. This is a wish list entry, so we'll mark 16 00:01:41,137 --> 00:01:48,190 that. And we'll do a stub. 17 00:01:48,190 --> 00:01:52,580 So that's the wish list entry for solved. The other function that we named in 18 00:01:52,580 --> 00:01:59,098 solved but we didn't do a wish list for, it doesn't exist yet, is next-boards. 19 00:01:59,098 --> 00:02:04,258 See next-boards is right here. And what does next-boards do? 20 00:02:04,258 --> 00:02:15,069 Well, next-boards consumes a board and it has to produce a list of board and, what 21 00:02:15,069 --> 00:02:20,390 does it need to do? It needs to produce list of valid [SOUND] 22 00:02:20,390 --> 00:02:22,365 next boards, from board. [BLANK_AUDIO] Here's a case, this 23 00:02:22,365 --> 00:02:34,640 function's a little bit complicated now. Maybe we're going to want to expand on 24 00:02:34,640 --> 00:02:39,230 our 78 character rule. Then you might want to say a bit more 25 00:02:39,230 --> 00:02:45,526 about what it does. What it basically does is finds first 26 00:02:45,526 --> 00:03:01,130 empty square, fills it with [1, 9] and it keeps only the valid boards. 27 00:03:01,130 --> 00:03:08,570 And maybe I'll just make it more clear that's natural 1 to 9. 28 00:03:08,570 --> 00:03:11,570 And this is also wish list entry. Bang, bang, bang. 29 00:03:11,570 --> 00:03:28,340 And there's the stub. From here on out, this is a series of how 30 00:03:28,340 --> 00:03:33,270 to design function problems. What I'm going to do is provide video 31 00:03:33,270 --> 00:03:37,070 lectures for some of them. But they're really good practice, so you 32 00:03:37,070 --> 00:03:38,680 might want to try some of them on your own. 33 00:03:39,830 --> 00:03:42,140 I will say this. As you design these function you're 34 00:03:42,140 --> 00:03:45,810 going to end up using a number of helper functions. 35 00:03:45,810 --> 00:03:49,420 You'll end up using a number of the helper function rules that we've used. 36 00:03:49,420 --> 00:03:51,750 So, there is a little bit of work, to do here. 37 00:03:51,750 --> 00:03:55,400 All of it in some sense is review, although a couple of the functions are a 38 00:03:55,400 --> 00:03:58,410 bit tricky. So what you might want to do is start 39 00:03:58,410 --> 00:04:01,380 working on them. Look at the video solution. 40 00:04:01,380 --> 00:04:05,400 Go back and forth. Anyways, I'll end this video here with 41 00:04:05,400 --> 00:04:09,330 the wish list entries, and we'll pick up later with the solution to some of these. 42 00:04:09,330 --> 00:04:09,330 [BLANK_AUDIO]