Last active
October 13, 2024 21:03
-
-
Save PEZ/b00355c5b51c4e29e27a09b6ed2f7a73 to your computer and use it in GitHub Desktop.
Double Down – Rich 4Clojure Problem 15 – See: https://github.com/PEZ/rich4clojure
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
(ns rich4clojure.elementary.problem-015 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Double Down = | |
;; By 4Clojure user: dbyrne | |
;; Difficulty: Elementary | |
;; | |
;; Write a function which doubles a number. | |
(def __ :tests-will-fail) | |
(comment | |
) | |
(tests | |
(__ 2) := 4 | |
(__ 3) := 6 | |
(__ 11) := 22 | |
(__ 7) := 14) | |
;; To participate, fork: | |
;; https://github.com/PEZ/rich4clojure | |
;; Post your solution below, please! |
froucoux
commented
Oct 2, 2024
(def __ (fn double-down [n] ((partial * 2) n)))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment