nice... he approximately does with for loops what i do without the sugar, hence all the chained calls. i noticed i do a bit more than necessary (the reverse thing is a remainder of an early misinterpretation of the spec), but who cares, it works :)
however, odersky's short version doesn't solve the problem ;) it doesn't: * handle the - / and " chars * handle the fallback-case (print a number if no word fits) * format the output correctly removing all this from my code, just 2/3 of the current implementation remain. i updated my solution, it's a bit more elegant now. Am 22.09.2012 18:22, schrieb David Nolen: > On Sat, Sep 22, 2012 at 11:27 AM, Dennis Haupt <d.haup...@gmail.com > <mailto:d.haup...@gmail.com>> wrote: > > here's my solution: > https://gist.github.com/3766508 > > the original (done in 2 hours) solution is commented out. i made some > improvements and solved the whole thing in 39 lines (counting only the > content of "main"). doing it in the minimal amount of lines was not my > goal. i was trying to minimize the logic. shorter code was just a side > effect. > > try to beat it :). let's see how that looks in clojure. > > > Looks pretty convoluted ;) > > Here's Odersky's Scala version and mine that uses > core.logic http://gist.github.com/1107653. > > I'm headed to StrangeLoop so I don't have time to verify that the Scala > or my version fully satisfies the original problem description. But my > guess is that Odersky did really solve the original problem. > > David > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en