 What's up everybody welcome back to another Python programming video. We're looking at the Python challenge. We're finally on challenge number 11 And right in front of us is this picture. I really can't tell what it is It's it looks like a scene of some people walking I Can't tell what this is like a rooster head or he's on fire or I Just don't know There aren't any hints on the page. There's nothing here So I'm gonna go ahead and kind of view the page source try to investigate the title of this page is odd even Don't know what that means the image is cave dot jpeg There's even there's a section for the font here, but there is no text. There is no hint given to us so we just have this image to work with and Odd even whatever that means. I think cave might be a hint to like a Python module We need to use or something so Python cave. I'll look up But The Marburg of the virus disease. I don't get any Module documentation Oh, hey The colossal cave game in Python, that's pretty cool. So Alright, this is not what I was expecting There is no I don't think there's a cave module in Python nor would it if there were one I don't think it would help. I don't know if that's what it's supposed to be Let's look at the source odd even It looks like in the picture. I can see like It's full of dots. I mean that's pretty obvious right here. I'll zoom in But I don't know like how it's done. I think here I'll zoom back out and I'm gonna download it safe image as my desktop is cave dot jpeg And I'll fire it up. Oh Is it flickering for you a little optical illusion? Okay, sorry zoom in a little bit too much there. Oh, yeah It's a little freaky. There's a lot of black pixels. I Think that's what it is I'm gonna I'm gonna try opening in paint Click open with paints All right, so We zoom in here all these black. It's like all over the picture It is all over the picture I wonder if there are any that like aren't black because these look like I Zoom in here. I can't tell if this is my just my eyesight No, yeah, these get these get red Use my eyedropper tool these guys look like these aren't pure black. Can I edit this? Can I edit this color? Yeah, look look look look. There's 60 in red. It's not pure black. Oh Okay, so it does get something it looks like there are more down here these they're Not straight black not pure black These are Let's set my brush size to be smaller so I can If I go up to the top left And I started zero zero look look zero zero is black One one is black two two is black three three is black Two zero is black But there is no combination where it's an Even and an odd number for X and Y coordinates or an odd and even number For X and Y coordinates that is black. It's all Even and odd pairs for X and Y So that's what it must mean when it says odd even being our hint. I wonder if these pixels We can't are those gonna get us text. Is that gonna get us text? Okay, so either way it looks like we're gonna have to use a Python image module to loop through this Let's fire up a text editor I'm gonna save this in my desktop 11 dot pi import image image equals image open Cave dot jpeg is working with I'm gonna say width and height actually equal The image dot size because we're probably gonna need those Do I have my image working? Yes, okay, so Odd and even So for X in range Zero Size no width right and for Y in range. We don't even need this zero here height we'll do as well print character form of Image dot get pixel X and Y let's get every single pixel, but we want the odd and even ones so odd is just gonna be One plus Like plus one on the variable that we're looking at X or Y But it needs increment by two then so we do need these zero zero with to and Zero height to remember like in the last in one of the earlier challenges in one of the other videos. We were looking at XY and X like plus one Because that would get the next one corresponding and it's gonna do the same for the even Even and then this one will be odd Now when I run this, okay, it needs them in Integers not tuples get pixel takes two arguments three given I'm confused What is the problem? Maybe my parentheses don't match up. I think it needs a tuple for arguments. Yeah so indices get pixel character and then Tuple get pixel And parentheses on this an integer is required. Oh Right, right, right. This gets The chr function is what needs an integer So we need to like take out one of the values from this. Oh Okay That's doesn't look like what we want Yeah, I see space care. Hey, I do see values But none of those make sense to me. What if okay? I remember in the last tutorial Or the last challenge in the last video. We didn't use the text. We ended up using the pixels I wonder if there's something like and I know some of the pixels are in red, right? When we got to some of them. Yeah What if the message is stored in the pixels? Not in the like the text that you would get out of the pixel colors. Let's Okay, so Let's create a new image new image equals Let's say size equals width and height and then our new image can equal image dot new RGB type with the same size as the other one so We can do is we can once we loop through Let's say even can equal this and odd This Even though this get pixel is going to return color data for us, right? So even color and odd color here the coordinates are going to be x and y and x plus y And we'll say that new image can eat we can actually put a pixel on the new image and let's say x and y and That's going to be the even color and then we'll add a new one for x plus y and y plus 1 and Then the odd color Okay, I have too many parentheses at this point and we'll remove our indexing because Now we're just going to get the actual color data. So we don't need to index anything We're going to use it to put color data on the new image, I think So when you run this, okay, that works fine for us and new image Dot save save on our desktop. It's where I am. Let's say image.png save and run and image.png Hey, okay Get our number 11 nothing else. I Don't see. I mean I see some of the red, but that's all. What if we separate? I Edit it even first and then odd Well, that wouldn't have any difference would it? It wouldn't make any difference. Yes, the same So remember in the uh, this is me looking up the This is me looking up the documentation for the get pixel function The title is odd even not even odd. So it's not like But I mean when we add it to the image there is no order it's still going to put it where it needs to go Odd even or even odd there is no there's no question of order there What if we separated it into two images? So let's say even image so even image put pixel and odd image put pixel even We'll do one for odd now if we run this boop-doop Image Or that's the same image we were looking at before even still pretty black odd Find out There's nothing there for us. I'm gonna go back to our one image thing New image. I'm just control zing over and over and over again now if I run this okay back to our regular image Let's look at this a little more. Let's open this up open this up and paint open with paint Zoom in I see some of the like Green pixels here. It's all black. It's like all black. Oh Okay, there's color here. What is this? Is that an E? Oh Those are letters. I think I can barely see letters in there The I L evil That's gotta be it. That's gotta be it It's gotta be evil That's creepy Just like etch in like and red and blue and green and That's super creepy That's gotta be it. Let's go. Let's check it out. All right URL Evil oh, oh, that's it sweet. Holy crap That's pretty freaky And like in the original picture What the heck? All right. All right evil it is then I'll take that. I'll buy it. I don't mind. Oh, it is right there. Did I just miss it the first time? I zoomed in sorry guys super heavy zoom in Yeah, there it is. I feel like I just missed it. It's so faint kind of Maybe I'm just blind whatever All right. Wow Well, thanks for watching guys Thank you for putting up with me on this one I had to kind of poke around for a little bit, but that's super cool Did not expect evil to be The key flag All right Well, thanks guys. I hope you enjoyed this tutorial Hope you enjoyed this video this challenge this little riddle if you are enjoying the series Maybe like the video maybe leave me a comment. Let me know what you think constructive criticism I love that stuff and if you're feeling generous, maybe subscribe, you know, I'd love that. Thanks guys. I'll see you in the next tutorial