Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b6306cf
simple-cipher
tasxatzial Oct 12, 2025
67d011d
allergies
tasxatzial Oct 12, 2025
c46f2dd
anagram
tasxatzial Oct 12, 2025
1a5cf9b
armstrong-numbers
tasxatzial Oct 12, 2025
aee595d
atbash-cipher
tasxatzial Oct 12, 2025
9c4099f
change
tasxatzial Oct 12, 2025
56442da
collatz-conjecture
tasxatzial Oct 12, 2025
021fa9d
connect
tasxatzial Oct 12, 2025
9e8e688
dart
tasxatzial Oct 12, 2025
f6c64e8
diamond
tasxatzial Oct 12, 2025
ab2a2dc
difference-of-squares
tasxatzial Oct 12, 2025
83b171a
dnd-character
tasxatzial Oct 12, 2025
c49a7d7
dominoes
tasxatzial Oct 12, 2025
b7d32c2
eliuds-eggs
tasxatzial Oct 12, 2025
fb9ecca
gigasecond
tasxatzial Oct 12, 2025
4e4e2fb
high-scores
tasxatzial Oct 12, 2025
2f7a2dd
isbn
tasxatzial Oct 12, 2025
8f7540c
isogram
tasxatzial Oct 12, 2025
a259743
leap
tasxatzial Oct 12, 2025
6eb1c7b
list-ops
tasxatzial Oct 12, 2025
0fb9ba6
luhn
tasxatzial Oct 12, 2025
6738d93
matching-brackets
tasxatzial Oct 12, 2025
ed03e89
matrix
tasxatzial Oct 12, 2025
0569fe1
pangram
tasxatzial Oct 12, 2025
5c00442
pig-latin
tasxatzial Oct 12, 2025
21f48b3
pythagorean-triplets
tasxatzial Oct 12, 2025
1ae9344
resistor-color
tasxatzial Oct 12, 2025
1928d6b
resistor-color-duo
tasxatzial Oct 12, 2025
5e004df
reverse-string
tasxatzial Oct 12, 2025
8e43a31
robot-simulator
tasxatzial Oct 12, 2025
85b2ed8
roman-numerals
tasxatzial Oct 12, 2025
ee8d18f
run-length-encoding
tasxatzial Oct 12, 2025
e6dd70e
saddle-points
tasxatzial Oct 12, 2025
55bfc77
scrabble-score
tasxatzial Oct 12, 2025
59e7305
space-age
tasxatzial Oct 12, 2025
7b965ef
spiral-matrix
tasxatzial Oct 12, 2025
469fe96
square-root
tasxatzial Oct 12, 2025
1829e9a
sublist
tasxatzial Oct 12, 2025
52adaa2
sum-of-multiples
tasxatzial Oct 12, 2025
299f79c
transpose
tasxatzial Oct 12, 2025
4a76740
triangle
tasxatzial Oct 12, 2025
438679d
two-fer
tasxatzial Oct 12, 2025
637ca44
word-count
tasxatzial Oct 12, 2025
0899fe4
wordy
tasxatzial Oct 12, 2025
9fef079
yacht
tasxatzial Oct 12, 2025
b5131c4
break into multiple lines && misc fixes
tasxatzial Oct 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions exercises/practice/allergies/src/allergies.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
(ns allergies)

(defn allergic-to?
"Returns true if the score indicates an allergy to the allergen; otherwise, returns false"
"Returns true if the score indicates an allergy to the allergen;
otherwise, it returns false."
[score allergen]
;; function body
)

(defn allergies
"Returns all allergens associated with the score"
"Returns all allergens associated with the score."
[score]
;; function body
)
6 changes: 4 additions & 2 deletions exercises/practice/anagram/src/anagram.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(ns anagram)

(defn anagrams-for [word prospect-list] ;; <- arglist goes here
;; your code goes here
(defn anagrams-for
"Returns all words from candidates that are anagrams of the given word."
[word candidates]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns armstrong-numbers)

(defn armstrong?
"Returns true if the given number is an Armstrong number; otherwise, returns false"
"Returns true if the given number is an Armstrong number;
otherwise, it returns false."
[num]
;; function body
)
4 changes: 2 additions & 2 deletions exercises/practice/atbash-cipher/src/atbash_cipher.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(ns atbash-cipher)

(defn encode
"Encodes the given text using the Atbash cipher."
"Encodes text using the Atbash cipher."
[plaintext]
;; function body
)

(defn decode
"Decodes the given text using the Atbash cipher."
"Decodes text using the Atbash cipher."
[ciphertext]
;; function body
)
4 changes: 2 additions & 2 deletions exercises/practice/change/src/change.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns change)

(defn issue
"Given an amount to change and a set of coins, it returns the
fewest coins such that the sum of their values equals the change"
"Given an amount to change and a set of coins, it returns the fewest coins
such that the sum of their values equals the change."
[amount coins]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns collatz-conjecture)

(defn collatz
"Returns the number of steps it takes to reach 1 according
to the rules of the Collatz Conjecture."
"Returns the number of steps for num to reach 1
according to the Collatz Conjecture."
[num]
;; function body
)
1 change: 1 addition & 0 deletions exercises/practice/connect/src/connect.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(defn connect-winner
"Returns the winner of the given connect board."
[board]
;; function body
)
2 changes: 1 addition & 1 deletion exercises/practice/darts/src/darts.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns darts)

(defn score
"Calculates the score of a dart throw"
"Calculates the score of a dart throw."
[x y]
;; function body
)
2 changes: 1 addition & 1 deletion exercises/practice/diamond/src/diamond.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns diamond)

(defn diamond
"Returns the diamond shape for a letter."
"Returns a diamond shape pattern for the given letter."
[letter]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
(ns difference-of-squares)

(defn square-of-sum
"Returns the square of the sum of the numbers up to the given number"
[n]
"Returns the square of the sum of the numbers up to N."
[N]
;; function body
)

(defn sum-of-squares
"Returns the sum of the squares of the numbers up to the given number"
[n]
"Returns the sum of the squares of the numbers up to N."
[N]
;; function body
)

(defn difference
"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"
[n]
"Returns the difference between the square of the sum
and the sum of the squares of the numbers up to N."
[N]
;; function body
)
6 changes: 3 additions & 3 deletions exercises/practice/dnd-character/src/dnd_character.clj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(ns dnd-character)

(defn score-modifier
"Calculates a score's modifier"
"Calculates the modifier of the given score."
[score]
;; function body
)

(defn rand-ability
"Generates a random ability"
"Generates a random ability."
[]
;; function body
)

(defn rand-character
"Generates a random character"
"Generates a random character."
[]
;; function body
)
5 changes: 3 additions & 2 deletions exercises/practice/dominoes/src/dominoes.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns dominoes)

(defn can-chain?
"Given a collection of dominoes, it returns true if they can be arranged into a chain; otherwise, it returns false"
"Given a collection of dominoes, it returns true if they
can be arranged into a chain; otherwise, it returns false."
[dominoes]
;; function body
)
)
2 changes: 1 addition & 1 deletion exercises/practice/eliuds-eggs/src/eliuds_eggs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

(defn egg-count
"Returns the number of 1 bits in the binary representation of the given number."
[number]
[num]
;; function body
)
2 changes: 1 addition & 1 deletion exercises/practice/gigasecond/src/gigasecond.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns gigasecond)

(defn from
"Determines the date one gigasecond after the given date"
"Determines the date one gigasecond after the given date."
[date]
;; function body
)
8 changes: 4 additions & 4 deletions exercises/practice/high-scores/src/high_scores.clj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
(ns high-scores)

(defn scores
"Returns all scores"
"Returns all scores."
[scores]
;; function body
)

(defn latest
"Returns the latest score"
"Returns the latest score."
[scores]
;; function body
)

(defn personal-best
"Returns the top (highest) score"
"Returns the top (highest) score."
[scores]
;; function body
)

(defn personal-top-three
"Returns the top three scores"
"Returns the top three scores."
[scores]
;; function body
)
3 changes: 2 additions & 1 deletion exercises/practice/isbn-verifier/src/isbn_verifier.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns isbn-verifier)

(defn isbn?
"Returns true if the given isbn is valid; otherwise, returns false"
"Returns true if the given isbn is valid;
otherwise, it returns false."
[isbn]
;; function body
)
3 changes: 2 additions & 1 deletion exercises/practice/isogram/src/isogram.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns isogram)

(defn isogram?
"Returns true if the given string is an isogram; otherwise, returns false"
"Returns true if the given string is an isogram;
otherwise, it returns false."
[s]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns largest-series-product)

(defn largest-product
"Returns the largest product of any consecutive digits of length span in the string s."
"Returns the largest product of any consecutive digits of length span
in the string s."
[span s]
;; function body
)
3 changes: 2 additions & 1 deletion exercises/practice/leap/src/leap.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns leap)

(defn leap-year?
"Determine if a year is a leap year"
"Returns true if the given year is a leap year;
otherwise, it returns false."
[year]
;; function body
)
23 changes: 15 additions & 8 deletions exercises/practice/list-ops/src/list_ops.clj
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
(ns list-ops)

(defn append
"Given two vectors, it adds all the items in the second vector to the end of the first vector"
"Given two vectors, it adds all the items in the second vector to the
end of the first vector."
[coll1 coll2]
;; function body
)

(defn concatenate
"Given a vector of vectors, it combines all the vectors into one flattened vector"
"Given a vector of vectors, it combines all the vectors into one flattened
vector."
[colls]
;; function body
)

(defn select-if
"Given a predicate and a vector, it returns the vector of all items for which predicate(item) is true"
"Given a predicate and a vector, it returns the vector of all items for
which predicate(item) is true."
[pred coll]
;; function body
)

(defn length
"Given a vector, it returns the number of items within it"
"Given a vector, it returns the number of items within it."
[coll]
;; function body
)

(defn apply-to-each
"Given a function and a vector, it returns the vector of the results of applying function(item) on all items"
"Given a function and a vector, it returns the vector of the results of
applying function(item) on all items."
[f coll]
;; function body
)

(defn foldl
"Given a function, a vector, and initial accumulator, it folds (reduces) each item into the accumulator from the left"
"Given a function, a vector, and initial accumulator, it folds (reduces)
each item into the accumulator from the left."
[f coll acc]
;; function body
)

(defn foldr
"Given a function, a vector, and an initial accumulator, it folds (reduces) each item into the accumulator from the right"
"Given a function, a vector, and an initial accumulator, it folds (reduces)
each item into the accumulator from the right."
[f coll acc]
;; function body
)

(defn reverse-order
"Given a vector, it returns a vector with all the original items, but in reverse order"
"Given a vector, it returns a vector with all the original items, but in
reverse order."
[coll]
;; function body
)
4 changes: 2 additions & 2 deletions exercises/practice/luhn/src/luhn.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns luhn)

(defn valid?
"Returns true if the given number is valid according
to the luhn algorithm; otherwise, returns false."
"Returns true if the given string is a valid number;
otherwise, it returns false."
[s]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns matching-brackets)

(defn valid?
"Returns true if the given string has properly matched brackets; otherwise, returns false."
"Returns true if the given string has properly matched brackets;
otherwise, it returns false."
[s]
;; function body
)
8 changes: 4 additions & 4 deletions exercises/practice/matrix/src/matrix.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(ns matrix)

(defn get-row
"Returns the i-th row of the matrix s"
[s i]
"Returns the i-th row of the matrix."
[matrix i]
;; function body
)

(defn get-column
"Returns the i-th column of the matrix s"
[s i]
"Returns the i-th column of the matrix."
[matrix i]
;; function body
)
3 changes: 2 additions & 1 deletion exercises/practice/pangram/src/pangram.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns pangram)

(defn pangram?
"Returns true if the given string is a pangram; otherwise, returns false"
"Returns true if the given string is a pangram;
otherwise, it returns false."
[s]
;; function body
)
2 changes: 1 addition & 1 deletion exercises/practice/pig-latin/src/pig_latin.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns pig-latin)

(defn translate
"Translates phrase from English to Pig Latin"
"Translates phrase from English to Pig Latin."
[phrase]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns pythagorean-triplet)

(defn find-pythagorean-triplets
"Given an integer N, it returns all Pythagorean triplets for which a + b + c = N"
"Given an integer N, it returns all Pythagorean triplets
for which a + b + c = N."
[N]
;; function body
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns resistor-color-duo)

(defn resistor-value
"Returns the resistor value based on the given colors"
"Returns the resistor value based on the given colors."
[colors]
;; function body
)
2 changes: 1 addition & 1 deletion exercises/practice/resistor-color/src/resistor_color.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
)

(defn color-code
"Returns the numerical value associated with the given color"
"Returns the numerical value associated with the given color."
[color]
;; function body
)
Loading