clojure
clojure copied to clipboard
Create generator for practice exercises
This issue keeps track of which practice exercises have had a generator added to them:
- [ ] accumulate
- [x] acronym
- [ ] all-your-base
- [x] allergies
- [x] anagram
- [x] armstrong-numbers
- [x] atbash-cipher
- [ ] bank-account
- [ ] beer-song
- [ ] binary
- [x] binary-search
- [ ] binary-search-tree
- [ ] bob
- [x] change
- [ ] clock
- [x] collatz-conjecture
- [ ] complex-numbers
- [ ] crypto-square
- [x] diamond
- [x] difference-of-squares
- [x] dominoes
- [x] eliuds-eggs
- [ ] etl
- [x] flatten-array
- [ ] flower-field
- [ ] gigasecond
- [ ] go-counting
- [ ] grade-school
- [x] grains
- [x] hamming
- [ ] hello-world
- [ ] hexadecimal
- [x] isbn-verifier
- [x] isogram
- [ ] kindergarten-garden
- [x] largest-series-product
- [x] leap
- [x] leap
- [x] list-ops
- [x] luhn
- [x] matching-brackets
- [ ] meetup
- [ ] minesweeper
- [x] nth-prime
- [ ] nucleotide-count
- [ ] octal
- [x] pangram
- [ ] pascals-triangle
- [x] perfect-numbers
- [ ] phone-number
- [x] pig-latin
- [ ] poker
- [ ] pov
- [x] prime-factors
- [x] protein-translation
- [ ] proverb
- [x] pythagorean-triplet
- [ ] queen-attack
- [x] raindrops
- [x] reverse-string
- [x] reverse-string
- [x] rna-transcription
- [ ] robot-name
- [x] robot-simulator
- [x] roman-numerals
- [ ] rotational-cipher
- [x] run-length-encoding
- [ ] say
- [x] scrabble-score
- [ ] secret-handshake
- [x] series
- [x] sieve
- [x] space-age
- [x] spiral-matrix
- [x] strain
- [x] sublist
- [x] sum-of-multiples
- [x] transpose
- [x] triangle
- [ ] trinary
- [x] two-fer
- [ ] word-count
- [x] wordy
- [x] yacht
- [ ] zipper
I tried to more elegantly handle keywords and maps, but finally found out why it didn't work:
(defn- wrap-context [model]
(clojure.walk/postwalk
#(cond
(map? %) (java.util.HashMap. ^java.util.Map %)
(keyword? %) (name %)
:else %) model))
We're basically always losing information before rendering.
I've tried monkey patching that function but then hbs just crashes