So you want to search the grid from left to right, right to left, top to bottom, and diagonally. You can keep things simple for now by searching just from left to right. Explore list manipulation functions and the similarities between the Bool and Maybe types.
- [Instructor] In this video we're going to search…for words in the grid that we created…in the previous videos.…In order to do that, we're going to look at…how to find a string inside another string using functions…like isInfixOf.…We're going to look at how to transform lists…using functions map and reverse,…and we'll see how to use the boolean and maybe data types.…In the previous video,…we saw how to output the grid,…and of course we also defined a list of words to search for.…
In this case programming languages,…and we want to take these words like Haskell…and search for them in the grid from left to right,…from right to left, top to bottom,…bottom to top, and of course diagonally,…and that right now seems like quite an ambitious task.…So let's simplify it as much as possible…and say that for now we look for a word…just from left to right.…In the case of Haskell, we can see that…looking for it on this line wouldn't find a result,…nor on this line, but when we get to this line,…we actually would find the word here.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Discovering Haskell with GHCI
- Haskell datatypes and functions
- Using higher order functions for data manipulation and code reuse
- Editing Haskell source code
- Creating a project with Stack
- Writing and conducting tests