1 00:00:06,140 --> 00:00:09,540 Now, I'm going to complete the design of layout-images. 2 00:00:09,540 --> 00:00:11,520 There's nothing really new in this function. 3 00:00:11,520 --> 00:00:15,300 You know how to design it at this point, but I suggest you follow along with me 4 00:00:15,300 --> 00:00:19,146 anyways. I think you might have heard me say once 5 00:00:19,146 --> 00:00:21,720 or twice that you can never get too much practice. 6 00:00:23,290 --> 00:00:26,230 Now, I want to complete the design of layout-images. 7 00:00:26,230 --> 00:00:30,126 So, the next thing I need to do is some check expects. 8 00:00:30,126 --> 00:00:36,842 Check expect layout-images. Let's see the empty, if you layout the 9 00:00:36,842 --> 00:00:40,512 empty images then that's just going to produce blank. 10 00:00:40,512 --> 00:00:46,362 And now, we'll do one for layout-images of let's see, you know, we can grab this 11 00:00:46,362 --> 00:00:54,050 example from up here, it's a perfectly good example that's too long. 12 00:00:59,070 --> 00:01:02,150 In a minute, I'll use command i to fix the indentation. 13 00:01:02,150 --> 00:01:05,121 Let me just do that, command i fixes the indentation. 14 00:01:05,121 --> 00:01:09,740 Layout-images, well, what's that going to be? 15 00:01:09,740 --> 00:01:11,300 We kind of figured this out before. Right? 16 00:01:11,300 --> 00:01:28,657 It's beside, of this rectangle, this rectangle and blank. 17 00:01:28,657 --> 00:01:34,543 I'll run that. The tests are well formed, but now a 18 00:01:34,543 --> 00:01:46,762 number of tests are failing. I'll go get the template, I'll paste it 19 00:01:46,762 --> 00:01:56,315 in here. I'll comment out the stab, ow! 20 00:01:56,315 --> 00:02:03,669 Meaning the template and the natural recursion. 21 00:02:03,669 --> 00:02:09,150 And now, let's see, if I'm laying out an empty list of integers I've produced 22 00:02:09,150 --> 00:02:14,370 blank, and otherwise, I just put the first image beside the result of the 23 00:02:14,370 --> 00:02:21,410 natural recursion command and fixes the annotation. 24 00:02:21,410 --> 00:02:24,099 I run it. Let's see, there's one test, I have to be 25 00:02:24,099 --> 00:02:27,400 careful. And now one of the four tests are 26 00:02:27,400 --> 00:02:30,350 failing. First thing I need to know is that, is 27 00:02:30,350 --> 00:02:33,300 that a test on layout-images. And it isn't. 28 00:02:33,300 --> 00:02:35,740 When I click on it, it's a test on arrange images. 29 00:02:35,740 --> 00:02:38,730 So, layout-images is actually working properly now. 30 00:02:41,060 --> 00:02:43,460 Why is this test on arrange images failing? 31 00:02:43,460 --> 00:02:51,100 Oh, look, this other test isn't failing. What's happening here is, the arrange 32 00:02:51,100 --> 00:02:56,678 images test where the list doesn't require sorting is working fine. 33 00:02:56,678 --> 00:03:02,160 The arranged images test where the list does require sorting isn't working. 34 00:03:02,160 --> 00:03:06,430 And that's because of this stab we made for sort images that just produces 35 00:03:06,430 --> 00:03:11,930 whatever it's given. If you happen to call sort images with a 36 00:03:11,930 --> 00:03:15,440 list that's already sorting, it happens to work. 37 00:03:15,440 --> 00:03:20,010 So, that's why one of these cases of arrange images is working, and one isn't. 38 00:03:20,010 --> 00:03:21,930 This is going to start to happen more and more. 39 00:03:21,930 --> 00:03:25,450 As you get a big program with multiple stabs in it, some tests might work, some 40 00:03:25,450 --> 00:03:29,762 other tests might not work. The key thing is, since I just finished 41 00:03:29,762 --> 00:03:33,346 layout-images, what I want to be sure is that those tests are passing, and they 42 00:03:33,346 --> 00:03:37,260 are. So, layout-images seems to be done now. 43 00:03:37,260 --> 00:03:42,000 Going back to my overview diagram of where we are in the overall process, 44 00:03:42,000 --> 00:03:49,000 arrange images is still done except it has uncompleted wish list entries. 45 00:03:49,000 --> 00:03:52,965 The layout-images wish list entry is completely done, layout-images is done 46 00:03:52,965 --> 00:03:57,400 and tested. But sort-images is still sitting there in 47 00:03:57,400 --> 00:04:00,994 stab form. That's what we are going to turn to in 48 00:04:00,994 --> 00:04:03,160 the next video.