Intro to Elixir | Lesson 15: Drills and Tips - Part 4


English (Auto-generated)

Hello, Friends. Um in this lesson, I'm basically just going to introduce you guys. Exorcism. I know I've mentioned it before, I've probably shown it briefly, but I just wanna show it again to just emphasize that um you should probably go ahead and try to do as many of the exorcism exercises as you can. Um What I like about it is that they tend to go up in difficulty, so as you do more, some more of them will um will unlock and then you basically keep improving your skills and some of them include instructions as well, which can help you learn new things in elixir. So here's one called back man rules. So what usually do you usually start by running the tests? Um So here we have six failing tests and you start to implement the code on the left here and uh following the instructions that you see on the right. So the first one here, it says defined if pac man eats a ghost. So the idea is we um define this ghost method, it's not implemented right here, so we basically have to implement it in case I didn't mention it before. If a method has a question mark at the end, it's a convention, not necessarily a hard requirement, but just a convention that this function will return true or false. So that's what it means. So this is why if you see here, this function should return true or false. So the idea here, if basically if a pac man has a power pellet Active and if a pac man is touching a ghost. Um and then return the value of the pac man is able to eat the ghost, the function should return through only if the pac man has a power pellet active and is touching the ghost. So the way we can implement it right here, this is again a classic example of a time where we could use um pattern matching. So we could say well it has to fill it, it's touching a ghost and we return true otherwise we return false and we tried to run the tests again. Now it says I have an error here. Um So let's try to find out what mistake did I make in this particular case it says online for cured argument must be followed by a space after. So let's try this again. Alright, so now I have seven tests passed. So one more test is passing because I've implemented this um portion of this exercise again, you should continue to do the other exercises to get more tests to pass. So yeah, I would highly encourage you to simply go and look at the electoral track and exorcism. Um It seems like they have 153 total exercises. Um In my advice, I mean if you remember we did this exercise which is um solving this um problem which is writing a piece of code that finds the most recurring letter in a given string. Um Some of you may have found this challenging because it does incorporate many of the concepts that we've learned in this series so far. Uh, so if you're struggling with any of these pieces, if you find that, you know, maybe you're struggling with lists or maps or strings or piping functions or this, I would encourage you to go and dig deeper and do more exercise. It's very important that you master those skills before you move on to learn some other concepts. That's all I wanted to cover for this lesson. Thank you and see you next time.
61 Views 0 Likes 0 Comments

Showcasing Exercism

Leave a comment (supports markdown format)