I hereby claim:
- I am jlemmett on github.
- I am jannel (https://keybase.io/jannel) on keybase.
- I have a public key ASCcGtc5gKugQ5Lq3rR9j20cFTK6A6aJQ6OJOl-NNkwECQo
To claim this, I am signing this object:
;; Apufunktio, joka muuttaa merkkijonoluvun numeeriseksi tyypiksi | |
(defn as-int [char] | |
(Character/getNumericValue char)) | |
;; Funktio, joka palauttaa suurimman viiden peräkkäisen numeron tulon annetusta lukumerkkinonosta | |
(defn max-of-5-multiply-v1 [str] (apply max (map #(apply * %) (partition 5 1 (map as-int str))))) | |
;; Käyttöesimerkki |
;; A helper function that converts a single character string into a numeric value | |
(defn as-int [char] | |
(Character/getNumericValue char)) | |
;; The solution as a one-liner: function that returns the largest multiple of 5 | |
;; consecutive digits in the given string of digits | |
(defn max-of-5-multiply-v1 [str] | |
(apply max (map #(apply * %) (partition 5 1 (map as-int str))))) |
;; Require lein-exec plugin so that we can run this as a standalone | |
;; script | |
;; Usage: | |
;; - 'lein exec anyfailures.clj' (looks for tests under ./test/system/results/ | |
;; - 'lein exec anyfailures.clj foo' (looks for tests under ./foo/ | |
(require 'leiningen.exec) | |
;; Add and require Enlive so we can parse HTML | |
(leiningen.exec/deps '[[enlive/enlive "1.1.4"]]) | |
(require '[net.cgrand.enlive-html :as html]) |
(require 'leiningen.exec) | |
(leiningen.exec/deps '[[enlive/enlive "1.1.4"]]) | |
(require '[net.cgrand.enlive-html :as html]) | |
(defn result-file-loc | |
"Returns the location of the result files (either provided as the first | |
command line argument or a default value of 'test/system/results'" | |
[] | |
(let [first-cmd-line-arg (second *command-line-args*)] | |
I hereby claim:
To claim this, I am signing this object: