So we're going to talk about this creating the unique pattern generator, because first let's see what
you need to create a unique pattern, because in the previous years by Facebook, we have our first
application with the audience.
So you cannot determine whether it contains which office.
So you have settings for 2000 years and which is has been awful in a year, whether it is fifteen hundred
years or seventeen hundred year already, we don't know because every year is similar and we cannot
find the offset for this year.
So to accurately rate the AP with some jump address, you need to exactly find it.
How much of it is going to be all right.
So that's why you create a unique pattern so that not three, not three characters are there is not
Twitter.
So if you say you did it and now three consecutive bites are repeated in the cohosting.
So whenever we put it into this application, these four bytes will not be repeated again in the pattern.
So you can just these four bits will be unique and these four words will be unique.
Say quickly and this will be your hit.
And this radical anextra, those four unique characters defines the offset of a particular EOP.
Yes.
So for that, we need to create the unique pattern so that minimum, at least three consecutive characters
are not repeated in our intention.
So let's go ahead and create our, uh, script in the python.
You can have matters us produce, but it's always good to have a Python script, so that's not random.
So I'll tell you why we are importing this one.
Now, my idea is, let's say creating the list.
And in the script I want to put all the halfwits uppercase of its workers alphabet and numbers.
So I have created the list, which contains uppercase alphabet's letters afterwards and the numbers,
so I don't want to use I want to create a variable pattern and it's a temptation for now.
And what we're going to do is we want to ask the user for that length.
So pattern then.
User will do input as an integer, that's 2000 lenth pattern or to the current pattern, except.
And then.
I know what you're going to want to randomly pick up any number, any element in this list and apply
it to better.
So you do that, so we will keep a for loop and we will do that these minute number of times so far,
right in the range of.
They'll come up Pattenden.
So what I want to do is I want to see a pattern, I want to apolo the random element to this pattern.
So I want to say there is a model called random, not random.
And so this will generate to a random number from the boundaries we have given.
It's a random random puff zero come up at the school.
So if the pattern content is 100, then this function will return a value that is random number between
zero and 100 that is pertinent.
So now what we want to do is this returns the number, right.
We need to set up a list of.
So we are moving over this zero to pattern, and for each iteration, we are picking up a random event
from happening to the pattern
of, OK, now we are going to print this pattern.
So let me run this.
Let me say 50, and as you can see, there is a random pattern.
Sorry, I need to take the tougher right.
Then Taffer minus one, because the three includes you, so no need to get in because it screws you
up problems.
One hundred.
To can concatenating, not integer, so let's say that's connected to a string because it's also selecting
the numbers which are there and which are at the end of this list.
I go ahead and run this first 100.
I want a hundred then better.
And as you can see, it's almost a unique pattern.
There is no there are no elements repeating the pattern.
Three should not R.M., unfortunately.
So this is our record pattern created.
Now, we would also add another functionality to search in the pattern.
Now we will ask the user for the input that sex is equal to, uh, in Peikoff since it's a screen,
when you say.
Interesting to research.
So we will also find the rest of this string using this excellent, let's say this would be excellent
to region of X.
So now in this pattern that I want to find ABC, so just for example.
So now what we're going to do is, uh, for I in range of zero comma Randolph pattern.
Or we can also put the pattern.
So what we're going to do is if the pattern is
elongated, etc., now we will take this for this X, that is the input sheet and we will compare it
with the first four letters.
But the trend is for right now, you can tell for sure if this is matches we than the index of this
one as we move on to the next four elements.
Not next for next, continue to fall first day and next week and next Khedive and etc..
So to do to do that for a range of gyro cover and pattern.
So for pattern,
we need to say, let's say temperature equals two.
So we need to get the first four elements.
So let's a lot of uh, I used to I press for so allow for it because, you know, and I love I press
for it because the fourth element.
Right.
Are I need to say I love eight plus this Trenta minus Andre.
Excellent.
Because the input piece for me cannot trade four because sometimes the condense five characters, uh,
let's say Xanatos Coldren minus one.
So now this gives the exact matching number of elements with the first one.
So now what I want to do is if M is equal to X then OK, let's say something like this list.
I want to say that I love this index.
Now, what we're going to open, we are going to win this because this is the index, we have four legs
of a.
Now, let's go and bring this in, the nexus.
So that's clear and this I hope you have understood this one where exactly comparing this element with
the element of this one, if it does not match us, we want to go next to four characters and so on.
So the 200 bates'.
Now, what I going to do is I want to find the index are starting for let me copy this one or just take
this one.
It's all have capitally.
And six, we should get.
So we do not get the correct answer, so let me fix where we have to draw.
So I think we are prepared for a range of tough battle for every, oh, four bites, this one.
All right, now let's put the whole program.
So that's underbite, and we want to say are one are eager to get.
Now, if you turn to.
So that's one hundred beats and it's the first one we need to find, the three are that.
So we are going from all the patronage tap into where you are is zero and dump should be very system
ABCDE.
Oh, I'm sorry, I'm sorry, I'm sorry.
So we need to see a pattern of I'm so sorry for this pattern of this one so that we get actual better,
so sorry for this.
So this is how you depict the programs and might zero.
I mean, you should get index zero.
OK, let me run that people Gregan.
So let me step through this, and we have got to illustratively are.
All right, we need to not put down minus one.
So let's go ahead and run this now here the character, I think I hope now that said, character w e
kit, we should get different.
So there you go.
We are going to zero.
And I know we get all the occurrences of this that week because that's why we are hoping from starting
to end.
So let's run this again.
Two hundred votes and let's any let's take any for which this one be benign.
And we'll basically focus on four weeks because this these are the two different registers.
Right.
So the maximum value could be four words, each word consisting of eight Mitsotakis, which so be nine.
We need to find this index.
So it's just 34 whenever you see like 89.
Were you in IPA piece pointing to this thing?
And then you understand that from a thirty five index we can after Petteway garbage values or some other
values.
We can.
Exactly right.
Happy with our value.
So that's how this works.
So I hope you have understood.
So this is a simple pattern in the letter, which does not use complex algorithms for selecting these
elements.
So this is just a simple one.
It is very useful.
And in the next year, you will see how to create the pattern with the metal plate.