aboutsummaryrefslogtreecommitdiff
path: root/challenge-254/barroff/julia
diff options
context:
space:
mode:
authorBarrOff <58253563+BarrOff@users.noreply.github.com>2024-02-05 21:23:29 +0100
committerBarrOff <58253563+BarrOff@users.noreply.github.com>2024-02-05 21:23:29 +0100
commit58f310b6a8abc7f65d6690ea071844f97ad00d75 (patch)
tree1039f24e08d5403adfdb7707e9181b74cb015911 /challenge-254/barroff/julia
parent04c92115f9c30fedf9839a7d0c2e0705914a35a8 (diff)
downloadperlweeklychallenge-club-58f310b6a8abc7f65d6690ea071844f97ad00d75.tar.gz
perlweeklychallenge-club-58f310b6a8abc7f65d6690ea071844f97ad00d75.tar.bz2
perlweeklychallenge-club-58f310b6a8abc7f65d6690ea071844f97ad00d75.zip
feat: add solutions for challenge 254 from BarrOff
Diffstat (limited to 'challenge-254/barroff/julia')
-rw-r--r--challenge-254/barroff/julia/ch-1.jl14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-254/barroff/julia/ch-1.jl b/challenge-254/barroff/julia/ch-1.jl
new file mode 100644
index 0000000000..32b93c020d
--- /dev/null
+++ b/challenge-254/barroff/julia/ch-1.jl
@@ -0,0 +1,14 @@
+#!/usr/bin/env julia
+
+using Test: @test, @testset
+
+function three_power(n::T) where {T<:Integer}
+ power_set = Set([x^3 for x = 0:ceil(sqrt(n))])
+ return n in power_set
+end
+
+@testset "three power" begin
+ @test three_power(27) == true
+ @test three_power(0) == true
+ @test three_power(6) == false
+end