Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From One End to the Other (Elm)
import Graphics.Element exposing (show)
import Array exposing (..)
import String exposing (..)
magicNumber : Array Int
magicNumber =
let
isNumber number =
String.right 1 (toString(number)) == "6" &&
(String.append "6" (String.dropRight 1 (toString(number))))
== toString(number * 4)
in
Array.filter isNumber (initialize 100000 (\n -> n * 2))
main = show magicNumber
-- Array.fromList [153846]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.