Skip to content

Commit

Permalink
Refactor: Adds new line at end of file
Browse files Browse the repository at this point in the history
- Also cljc -> clj
  • Loading branch information
FrankKair committed Jun 14, 2018
1 parent 81cac22 commit aae4df4
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/001/p001.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
(= (rem %1 5) 0)))
(reduce +)))

(prn (solve))
(prn (solve))
2 changes: 1 addition & 1 deletion src/001/p001.fut
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ let divisible (n: i32): bool = ((n %% 3i32) == 0i32) || ((n %% 5i32) == 0i32)

let solve(): i32 = reduce (+) 0i32 (filter divisible (3i32...999i32))

let main (): i32 = solve()
let main (): i32 = solve()
3 changes: 1 addition & 2 deletions src/001/p001.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ function solve()
end

result = solve()

println(result)
println(result)
4 changes: 1 addition & 3 deletions src/002/p002.cljc → src/002/p002.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
; works in both clojure and clojurescript

(defn solve []
(let [fib-iterator (fn [[fj fk]] [fk (+ fj fk)])
fib-lazy (iterate fib-iterator [1 1])
Expand All @@ -8,4 +6,4 @@
([acc n] (if (< n (* 4 1e6)) (+ acc n) (reduced acc))))]
(transduce treat-fib limited-sum 0 fib-lazy)))

(prn (solve))
(prn (solve))
4 changes: 1 addition & 3 deletions src/004/p004.cljc → src/004/p004.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
; works in both clojure and clojurescript

(defn solve []
(let [palindrome? #(let [sn (str %)] (= sn (apply str (reverse sn))))
products (for [x (range 999 99 -1) y (range 999 99 -1)] (* x y))]
(transduce (filter palindrome?) max 0 products)))

(prn (solve))
(prn (solve))
2 changes: 0 additions & 2 deletions src/005/p005.cljc → src/005/p005.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
; works in both clojure and clojurescript

(defn solve []
(let [candidates (range (* 11 13 17 19 2520 2)
(reduce * 2 (range 3 20 2))
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions src/007/p007.cljc → src/007/p007.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
; works in both clojure and clojurescript

(defn next-primes [[primes new]]
(let [new* (inc (inc new))]
(if (some #(= 0 (rem new %)) primes)
Expand All @@ -14,4 +12,4 @@
(map peek))]
(first (drop 10000 primes))))

(prn (solve))
(prn (solve))
2 changes: 1 addition & 1 deletion src/028/p028.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

(defn solve [] (spiral-diag-sum 1001))

(prn (solve))
(prn (solve))

0 comments on commit aae4df4

Please sign in to comment.