aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-252/wambash/julia/ch-1.jl18
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-252/wambash/julia/ch-1.jl b/challenge-252/wambash/julia/ch-1.jl
new file mode 100644
index 0000000000..849c07a864
--- /dev/null
+++ b/challenge-252/wambash/julia/ch-1.jl
@@ -0,0 +1,18 @@
+using Lazy
+using Primes
+
+special_numbers(ints) = @>> begin
+ ints
+ length
+ divisors
+ getindex(ints)
+ x -> x.^2
+ sum
+end
+
+
+using Test
+@testset "special numbers" begin
+ @test special_numbers([1,2,3,4]) == 21
+ @test special_numbers([2, 7, 1, 19, 18, 3]) == 63
+end