Takeaways

  • Practice reading and writing a functional programming language
  • Exposure to single-page web app development with Elm

Relevant Resources

This assignment will require you to use functions from the Elm core libraries. There are links below to some resources, but feel free to search for other resources online or ask your instructor. Note that this is not an exhaustive list of Elm resources. You may decide to use other core libraries, as well.

Flight Simul-inator

Our Story Continues

Your Task

For your final assignment, you are to develop a blimp flight simulator (simul-inator) to test D.E. Inc’s pilots’ abilities. You are to add the following features to the starter program:

  1. A scoreboard.
  2. Function-level documentation.

Your completed assignment should be well documented, and it should function the same as the reference implementation.

Using the Simulator

The simulator works as follows:

  1. Click anywhere in the sky area to fire the blimp’s thrusters.
  2. Don’t let the blimp fall to the ground.
  3. Don’t let the blimp rise out of the atmosphere.
  4. Don’t let the blimp hit any clouds.

Working on the Program

You’re welcome to install Elm, and work on this assignment on your own machine or a lab machine. However, this assignment has been intentionally designed, so that you can do the whole thing in the online editor available on Elm’s website.

Note: Be careful working in Elm’s online editor. It will not save your work. You should copy your program into a text editor and save it periodically.

Remember that we’re using Elm version 0.18. That’s what the online editor uses.

Further Details

Code Expectations

  • You are welcome to add additional functions, but they must have documentation and type annotations.
  • You are expected to document this program. This includes functions that you did not write. The provided comments are not sufficient.

Approaching this Assignment

You should tackle this assignment as follows:

  1. Read this entire posting and docs (you’ll likely do this more than once).
  2. Clone the code.
  3. Copy the existing Main.elm into http://elm-lang.org/try and compile it. Try using the compiled app to see what it does so far.
  4. Add brief documentation to each function in the existing program.
    • Every function should have documentation! That includes ones you didn’t write.
  5. Add the scoreboard functionality.
    • Use the scoreBoard : Int -> Svg.Svg GameEvent function to display the scoreboard. That part’s written for you.
  6. Check your style using the Elm Style Guide.
  7. Submit!

As you’re working, be sure to…

  • Compile frequently
  • Save frequently

Important Notes

  • All of your code should be within Main.elm. There is no need for multiple files for this assignment.
  • Comment your code and the code that’s already there.
  • Save your work frequently. Be careful with the online editor.
  • There is an alpha elm formatter out there that can format your code for you. Since it’s still in alpha, we’re not advocating that you use it. It’s more like a fun fact1.

Point Value

This assignment is worth 100 points. It will be graded according to the following rubric:

Feature Points Possible Mostly or completely incorrect (0% of points possible) Needs improvement (50% of points possible) Adequate, but still some deficiencies (75% of points possible) Mostly or completely correct (100% of points possible)
Functionality          
Program compiles successfully (no errors), and there is evidence of an earnest attempt to complete the program. 30 -30 -15 -8 0
Program behaves the same as the reference implementation 30 -30 -15 -8 0
Documentation          
Every module-level function is briefly2 and correctly documented 20 -20 -10 -5 0
Style          
Source uses good Elm style as described in http://elm-lang.org/docs/style-guide 10 -10 0
Code Review (well-documented, implementation is straightforward, etc.) 10 -10 -5 -3 0
Points possible 100        

Each cell indicates how many points out of the available points will be awarded for that feature (row) and assessment level (column).

Cells marked -- cannot be achieved.

Bonus Opportunity

You may modify the game or add additional feature(s) to earn up to 10 bonus points on this assignment.

To earn these points you must:

  1. Create a separate file called Bonus.elm that contains your bonus feature.
    • Main.elm should contain your regular, expected game that behaves like the reference implementation.
    • Bonus.elm should contain game with your proposed update.
  2. Include a single-paragraph description of your modification at the top of Bonus.elm.
    • We need to know what to expect.

Don’t forget to include your assignment solution in Main.elm. If you don’t have a working solution in Main.elm, we’re not going to grade the bonus.

Submission

Deadline

11:59:59 PM CST – Tuesday, December 12, 2017

Submission Procedure

Refer to the assignment submission page on the course website for details on submitting your code to GitLab.

Grading Procedure

When we grade your assignment, we will do the following (roughly).

# Compile your program using Elm 0.18
$ elm make src/Main.elm --output index.html

# Open your app and play around with it
$ chromium-browser index.html

Which is the same as pressing the Compile button on http://elm-lang.org/try.

  1. Like how cows can’t go down stairs, apparently. 

  2. No more than a sentence or two.