Review 2048
General: Both me and my exercise partner had a problem starting the game after compiling Main.elm with elm make:
- On my computer (running Windows) the generated index.html was displayed as a completely blank site in multiple browsers
- On the computer of my exercise partner (running Linux) the game did run, but the grid was displayed as a single column
Other than that, your code looked very nice in general. In most cases it was easy to understand, cleanly formatted, sufficiently commented and structured well.
There were some minor mistakes and other irritating things though:
Main.elm Line 27: Why aren't you using Array.repeat, as in the line before?
Line 57: This method seems unnecessary, but it's propably there for expandability
Line 58+: keyboardSubscribtion -> keyboardSubscription
Line 72: The arrow should be aligned with the ones above it
Line 74: puplish -> publish
Helpers.elm
Line 22: flip is unused and could be removed
Line 25: Nohing -> Nothing
Line 56: listGet is unused and could be removed
-- Overall: Nice and short functions with good descriptions and examples
View.elm
Line 53: else should be aligned with then
Model.elm
Line 22: Line should end with a dot, just as the ones above and below
Line 27+29: Why isn't there a space after size and fields?
Line 65: Good method to change only one value of a model
Line 79: I think the code would be easier to understand, if the getter gets the model here instead of in the move function, as updateWith receives the model anyway
Line 86: Couldn't you use Array.slice (row * m.size) ((row + 1) * m.size)?
Line 89+104: These functions would also work with the generic Array a
Line 97: I would move indexedFilter to Helpers.elm
Line 108: transpose would also work with the generic Array a and could then be moved to Helpers.elm
Line 116: <| can be removed, as there's only one argument after it
Edited by Leif-Erik Krüger