"Countdown"
- Shray Pungaliya
- Mar 9, 2017
- 1 min read
I have finished the first part of Programming in Haskell, the final part of the book being an extended programming example simulating and solving a game called "Countdown." In this game, a contestant is given a list of numbers and a final number. Using addition, subtraction, multiplication, division, and parentheses, the contestant must use numbers from the list (each number used a maximum of once) and the operators to create the final number. The program that this book guided me in writing takes a given list and final number, and then calculates the total number of solutions, printing them if the command is given. The purpose of this project was to use all the concepts learned over the past exercises and chapters in an engaging example.
While it has been difficult to pick up the individual concepts in this book, their application has been simple, and the advantage over object-oriented programming (the most common form of programming) clear. I now move forward to apply these concepts in creating a maze designing algorithm. As a guide, I will be using this blog post by Tikhon Jelvis.
Comments