functional-koans / clojure-koans

A set of exercises for learning Clojure
3.74k stars 2.14k forks source link

Conjoining an element to a list - context implies reversed operation #110

Closed draeath closed 8 years ago

draeath commented 8 years ago

In koans.03-lists, it appears (based on context) the intent is for the user to enter '(:a :b :c :d :e) as in the puzzle preceding it. However, conjoining to a list prefixes, rather than suffixes. Eg, the actual solution would be '(:e :a :b :c :d) instead.

This appears to be unintentional, and might stand to use a different sequence than the prior puzzle or perhaps some rewording to 'break' the incorrect implication?

trptcolin commented 8 years ago

Correct, conjing to a list adds to the left side, and conjing to a vector adds to the right side, and it'll show you that there's an error if you try '(:a :b :c :d :e) as the answer. I like the fact that guessing based on context gives the wrong answer sometimes, and it was definitely intentional in this case, because it forces people to slow down and really make sure they understand what's happening. I don't want these exercises to be super-difficult, but I also want people to be surprised occasionally. Make sense?

draeath commented 8 years ago

Yes! The same kind of thing where a multiple-choice answer key might have a short pattern of repetition - you'd intentionally break that pattern so the taker couldn't just follow the pattern but would have to actually think about the problem. Good thinking :D