 As I begin this video, I respectfully acknowledge that I'm standing in the unceded traditional territory of the Comox First Nation, and I thank them for the use of their lands. Now this particular challenge I'm going to do now is to take a sentence such as this, the sentence S, which is a list of words to be used as a target, and I want to create a verb that will allow me to select the first N words from that list. So if N equals 4, and I'll call the verb, which I've already created, called N0, and I work on this list, I'm going to get a list of words, perfect. So I've already figured out probably three or four different ways to do this, some of which are quicker than the way I'm going to do it right now. So I won't only be doing one version in this particular video, but in the coming days I'll go through them and add different versions, and if you're really a keener, then maybe what you want to do is get ahead of me and figure out different ways to do this, and maybe you'll come up with a faster way than I did, and that's quite possible, believe me, it's quite possible. But let's take a look at N0 first. So in a previous video I explored the cut conjunction. Cut conjunction looks like this, and if we put a verb, and we'll call it say U on this side, and we put a noun and we'll call it N on this side, the value of N changes how things are cut. From whatever argument, I'll call it Y out here, and typically a Y would be something like S, which we declared. So it's a noun that the verb is going to work on, and this altogether with this conjunction in the center, and the verb that we're going to have the conjunction act on, and the N that's going to kind of tell us the flavor of the conjunction, that's altogether one verb. And so let's take a look at the N first. If I put in a two here, that means I'm going to look at the last character of S, and I'm going to use that as my cut point. So in the NJ they call them frets. So at every T, I'm going to do a cut here. And since it's two, I'm looking at the last character in the list, and that would be T. If I had negative two, it would still be looking at the last character in the list, but it would get rid of the T's after I did my cuts. If I did a one, I would be looking at the first character in the list, and a negative one would do still, looking at the first character in the list, it would do the cut on the A's, and it would get rid of the A's after done the cut. So let's first, to make this really quite clear, that is the box now, and this box is whatever I send it. So I taking S, I'm looking at the last character in S, which is a T, and it's going to break it into segments wherever there's a T, and whenever it has that break, it's going to box it and return to me. So there we go. We have a list of words Ubi counted as a Arget, and because the cut's coming in right after the T's, that kind of makes sense. Now, if I did a negative two, remember it'll get rid of the T's afterwards. Perfect. But I don't really want to get rid of the T's, and I do have a problem here actually, because my last character in this list is not, is a T. So I don't really want to break things up this way. I want to break things up on each word. So each characters, and then when I look at this, the obvious thing is every word is separated by a space, right? A blank space. That's just sort of pretty much the definition of words is that we're going with it. But I don't have a black space at the end of this list. So what I'm going to do is I'm going to add one. So I'm going to change, there we go. So what this verb does is it joins things together. It appends things. And normally, if I gave it, say, the argument s, it would say, okay, well, I'm going to append whatever is on this side with s. But I'm binding it with this value here. So I'm forcing s to be put on this side. And if I hit return, it's going to look the same as it did before, except actually, I've put a blank space on the end. Well, the easy way to find that out is let's do this. I will take this, drop it in here. And now what it's going to do is going to put the blank space on the end, and then it's going to cut based on where the blank space is. And since I'm going to be boxing it, I should get a box of each different word. Perfect. Except you might notice I threw a negative two in here. I don't want to get rid of the blank spaces because if at the end of this, I do this thing called a raise, which is just basically flatten out all the boxes. That's what I get. Well, I don't want that. I will want the space because that's kind of what I want. But again, remember, I don't want the full list. I only want the first four. So it sort of gives you a clue about the way I'm going to go about this, though. What I will do, though, is if I take this and I put in a four and then I take, and this verb here is take, and it will take four and it will take the first four of whatever's here. And these would be the box things. And then I'm going to raise it afterwards. There's my answer. So I'm all done. Well, not actually. I'm only just beginning. And the reason is if I'm going to do this tacitly, which is the version I'm doing right here, you might notice I'm not actually using within this verb here. And this whole thing here is a verb within this verb here. I'm not actually using any variables. Everything is a noun or like in the case of its kids, a literal noun in the case of the blank space or an integer and verbs. And that's called point free. I'm not, I'm not saying, you know, bring in X or bring in Y. And this is where S will end up being put. I'm going to do it tacitly, which means I have to know how I'm building things here. So when I'm trying to build tacit verbs, there are two things. One is a fork and a fork. Let's take a look at a fork. I'll give four and a fork has three verbs. Oops. Error snippet. Wow. I've never seen that before. You'd think I would have seen everything. I've never seen an error snippet before. That's quite fascinating. That might be something that's new. So basically what's telling me is you gave me one argument. You never gave me the rest of the argument. And this in here is the verb and there are three verbs inside it. And that's what makes it a fork. The way a fork works is it's going to take these two arguments and it's going to apply them to either side of the minus. So it'll be four minus three. And then it's going to take these two arguments and it's going to apply them to either side of the plus four plus three. And then it takes the results of the two outside because it's a fork. They call them tines. So it takes the results of the outside tines and it appends them together. Just like that. So we got four minus three appended to four plus three. Now there's one other thing that's kind of interesting and that is called a hook. And how a hook works, I'm going to change this just slightly and you'll see why. A hook works if I've got two verbs, only two verbs in here. And what a hook does is this verb, which is the half verb, only takes this argument. So I'm going to take half of three, make that result and then I'm going to append it to four. So I can put two verbs together and then this first verb is actually going to like do some conditioning on this argument. And then I'll use this argument to do the rest of it. And I get that four and 1.5 because I'm four appended to half of three. Now notice in the fork both these arguments worked with the plus and both these arguments worked with the minus and then the append took over with the hook. This verb only works on this argument and this argument only works with this verb and the result of this verb. So it's subtle, but it's actually kind of a powerful thing to do. And we're going to actually use it right now. And the reason how we're going to use it is to take a look at this. I want to clean this up. So this is my first verb here. Yeah, I'm just appending the blank space to the end. And this is my second verb here. I don't have a third verb as far as I'm concerned yet. This is of course a verb, but that's tangled up with a four. I don't want to get that messed up yet. So what I'm going to do is I'm going to put a parentheses and then I'm going to put a cap. And what a cap is, it's just a dead end verb. It does nothing. And because it does nothing and because this is a fork, this s is going to have a blank appended to it. And then it's going to do a cut. It's just like this feeds it's just like this feeds to here because there's nothing coming from this side. If this had something else coming, then both these sides would feed into the center, but this is dead. So it only comes one way. And that's what I want it to do. Now remember we were talking about hooks before. So now what I'm going to do is I'm making this part of the, of this whole verb. It's a hook. So there's one verb here and then within the parentheses, there's one verb there. And I'll take that out for now just to show you where we are in the intermediate. So now we've got a list of words. Perfect. And I want it unboxed. So if you take a look at this, I've got a verb here and a verb here, but I also want to unbox it. Well, what I'm going to do is create another fork here. The reason I'm going to create another fork here is the first thing that this dyadic is going to do because remember I've got this four now working on one side of this verb. And then what's on here is coming in from the other side of the verb. So I will have two things coming. That's why this works middle part. I'll put my raise at the other end. I'm going to put a cap because now what I'm going to be doing is this four is going to work on this verb here, which is a fork. And because it's dyadic, it's going to take the results of this on one side on the right side of this verb, the take. It's going to take the four on the left side of the take. It's going to take my four boxes, which is what I want. And because this is a cap, it's just going to feed over here to raise it. So there's my list of words. And in that process, what have you learned? Well, I hope you learned a few things. But one thing you've learned is the way dyadic forks work, both here, which is, well, this actually isn't a dyadic fork, right? Because it's contained in a hook. It's only affected by this argument here. So technically, well not technically, actually, this is a monotonic fork. This is a dyadic fork because it's the second part of a hook. And the second part of a hook works on both its arguments. So this gets filtered into here, which provides all the boxing. And then this has the four working on it. So I get four, take the results of this, which gives me a list of words, and then feeds over because this here is another fork, and I'm raising it. So I'm setting that over there to raise it and take the boxes out. So forks hooks. And oh, I know what I'll do. Let's see. Yeah, that's what I want. But I'm going to, oops, let's see the way I defined it originally. And you can see it's got these parentheses. And it's got rid of the outside parentheses because it's just displaying what it knows. It basically is saying only look at the verb. And as soon as it's only look at the verb, I don't need the outside parentheses anymore. I do need them if I put arguments around them because then the verb has to be defined inside there. So having said that, now I want to know how quick it is. So I'm going to use time space X. And then within, so I'm going to 1000 times face X means I'm going to do this 1000 times for n zero s. So I'm going to execute this sentence 1000 times, it's going to return the number of seconds on average that it takes to run through this once, and then the number of bytes that it takes to run through once. So the answer is 6.99 just under 710 millionths of a second, or 0.7 millionths of a second, and just under 3000 bytes. So it's pretty quick. As I said, I found a quicker way. And if I'll put up another video, if you really want to go for the challenge, see if you can figure out, well, for one thing, a quicker way. And the way I found also uses less space. So that might be a bit of a clue, I suppose, I don't know. See if you can come up with something quicker or uses less space. And then check back. And if you don't want any spoilers, work based on what I've shown you here, I will say the next approach I took was quite different. It's not like I've used, no, I don't think I've used any of these, some of the same verbs, I suppose I'd have to use some of the same verbs, but it's really a different approach to it. That's one thing that I do like about J is it allows you to quickly do a number of different approaches to things. But anyway, I'll be back in a couple of days with another video, another way to retrieve the first N words out of a list of words.