Skip to content

Instantly share code, notes, and snippets.

@krzysu
Created December 22, 2017 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzysu/f9f737b17a31a7d0565e9df6d9c983ab to your computer and use it in GitHub Desktop.
Save krzysu/f9f737b17a31a7d0565e9df6d9c983ab to your computer and use it in GitHub Desktop.
double for-loop in elm ;)
getAllCoordinates : Int -> List ( Int, Int )
getAllCoordinates size =
let
lengthAsArray =
List.range 0 (size - 1)
in
lengthAsArray
|> List.concatMap
(\x ->
List.map
(\y -> ( x, y ))
lengthAsArray
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment