I’m teaching first-year CS in Kotlin and am lookin...
# education
e
I’m teaching first-year CS in Kotlin and am looking for ideas for a programming assignment that uses higher-order functions like
map
,
filter
,
any
, and
all
but does not have answers that could easily be found online. (It’s not that I don’t trust my students. I want them to be able to look for tips on the Internet but not to be able to find exact answers.)
a
The map-reduce is ideal for data processing. For example you can take a text, then split it into words and then do something like counting word frequencies. Or frequencies of word lengths. Or frequencies of words with given letters or combinations (filter).
p
I like asking students to solve a given problem with and without using higher-order functions. Functional skeptics usually see the light after the sequence exceeds 4 or 5 lambdas.