scalapuzzlers / scalapuzzlers.github.com

Github Pages behind scalapuzzlers.com
www.scalapuzzlers.com
161 stars 53 forks source link

new puzzler (easy 1) #109

Closed Nimrod007 closed 10 years ago

Nimrod007 commented 10 years ago

simple ++ on maps

demobox commented 10 years ago

Thanks for this, @Nimrod007! Could you explain how you consider this a puzzler, i.e. how the language here is behaving in an unexpected way?

A puzzler should ideally have the reader thinking that they know what the result should be, but then the language behaves differently. In this case, if you understand how ++ works, the language seems to behave predictably.

Nimrod007 commented 10 years ago

i agree that if you know how ++ works the answer is predictable.

demobox commented 10 years ago

Thanks, @Nimrod007! I've opened a new PR #110 to hopefully make things clearer.