Last active
January 29, 2016 23:03
-
-
Save jwworth/9315df793666708bfe8c to your computer and use it in GitHub Desktop.
From One End to the Other (Elm)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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