Skip to content

Commit 3f1d595

Browse files
authored
Update function templates (#856)
* simple-cipher * allergies * anagram * armstrong-numbers * atbash-cipher * change * collatz-conjecture * connect * dart * diamond * difference-of-squares * dnd-character * dominoes * eliuds-eggs * gigasecond * high-scores * isbn * isogram * leap * list-ops * luhn * matching-brackets * matrix * pangram * pig-latin * pythagorean-triplets * resistor-color * resistor-color-duo * reverse-string * robot-simulator * roman-numerals * run-length-encoding * saddle-points * scrabble-score * space-age * spiral-matrix * square-root * sublist * sum-of-multiples * transpose * triangle * two-fer * word-count * wordy * yacht * break into multiple lines && misc fixes
1 parent f187e03 commit 3f1d595

File tree

45 files changed

+117
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+117
-85
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
(ns allergies)
22

33
(defn allergic-to?
4-
"Returns true if the score indicates an allergy to the allergen; otherwise, returns false"
4+
"Returns true if the score indicates an allergy to the allergen;
5+
otherwise, it returns false."
56
[score allergen]
67
;; function body
78
)
89

910
(defn allergies
10-
"Returns all allergens associated with the score"
11+
"Returns all allergens associated with the score."
1112
[score]
1213
;; function body
1314
)
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
(ns anagram)
22

3-
(defn anagrams-for [word prospect-list] ;; <- arglist goes here
4-
;; your code goes here
3+
(defn anagrams-for
4+
"Returns all words from candidates that are anagrams of the given word."
5+
[word candidates]
6+
;; function body
57
)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns armstrong-numbers)
22

33
(defn armstrong?
4-
"Returns true if the given number is an Armstrong number; otherwise, returns false"
4+
"Returns true if the given number is an Armstrong number;
5+
otherwise, it returns false."
56
[num]
67
;; function body
78
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(ns atbash-cipher)
22

33
(defn encode
4-
"Encodes the given text using the Atbash cipher."
4+
"Encodes text using the Atbash cipher."
55
[plaintext]
66
;; function body
77
)
88

99
(defn decode
10-
"Decodes the given text using the Atbash cipher."
10+
"Decodes text using the Atbash cipher."
1111
[ciphertext]
1212
;; function body
1313
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(ns change)
22

33
(defn issue
4-
"Given an amount to change and a set of coins, it returns the
5-
fewest coins such that the sum of their values equals the change"
4+
"Given an amount to change and a set of coins, it returns the fewest coins
5+
such that the sum of their values equals the change."
66
[amount coins]
77
;; function body
88
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(ns collatz-conjecture)
22

33
(defn collatz
4-
"Returns the number of steps it takes to reach 1 according
5-
to the rules of the Collatz Conjecture."
4+
"Returns the number of steps for num to reach 1
5+
according to the Collatz Conjecture."
66
[num]
77
;; function body
88
)

exercises/practice/connect/src/connect.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
(defn connect-winner
44
"Returns the winner of the given connect board."
55
[board]
6+
;; function body
67
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(ns darts)
22

33
(defn score
4-
"Calculates the score of a dart throw"
4+
"Calculates the score of a dart throw."
55
[x y]
66
;; function body
77
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(ns diamond)
22

33
(defn diamond
4-
"Returns the diamond shape for a letter."
4+
"Returns a diamond shape pattern for the given letter."
55
[letter]
66
;; function body
77
)
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
(ns difference-of-squares)
22

33
(defn square-of-sum
4-
"Returns the square of the sum of the numbers up to the given number"
5-
[n]
4+
"Returns the square of the sum of the numbers up to N."
5+
[N]
66
;; function body
77
)
88

99
(defn sum-of-squares
10-
"Returns the sum of the squares of the numbers up to the given number"
11-
[n]
10+
"Returns the sum of the squares of the numbers up to N."
11+
[N]
1212
;; function body
1313
)
1414

1515
(defn difference
16-
"Returns the difference between the square of the sum of numbers up to a given number and the sum of the squares of those numbers"
17-
[n]
16+
"Returns the difference between the square of the sum
17+
and the sum of the squares of the numbers up to N."
18+
[N]
1819
;; function body
1920
)

0 commit comments

Comments
 (0)