1.6 Your first project

Welcome to your first project of this course. Every chapter will have a project, and they will increase in complexity and size as you get into later chapters.

Your first program will be a travel planner for your starship. Read the instructions at the top of the project file and fill in the missing parts of the program, as directed by the comments. Comments are not runnable code and are ignored by the compiler. They are any line in the code that begins with two dashes.

-- This is a comment.

Remember to delete the error message lines for each definition before writing your implementation. They look like this:

error "definition has not been implemented"

You can test each part of your program by loading the file into ghci and running the numbered test functions. To test part one, run test1, to test part two, run test2, and so on. Remember that you can reload the file in ghci using :reload after you make changes to it. Once you have completed the program, feel free to run main in ghci as a quick check to see if it works as expected. Then exit ghci and run the file from your terminal using runghc.

Download the project files using git as shown below.

$ git clone https://github.com/haskell-roguelike/project1.git

Or download the zip file directly.