FWIW (i.e. IMO the previous two functional solutions are better
examples) here is a more imperative style solution done sort of to
prove to myself that I could do such a thing in Clojure w/o too much
(arguable) fanfare. Maybe it will be interesting to others who are
learning Clojure too
(defn sc
An artifact of not running my code from a clean REPL before posting ;)
It should just read `frames'.
Cheers,
Mark
artg writes:
> What is "group-frames"?
>
> --art
>
> On Jul 21, 12:00 am, Mark Triggs wrote:
[...]
>> (defn score-game [rolls]
>> (reduce + (map #(reduce + %)
>>
What is "group-frames"?
--art
On Jul 21, 12:00 am, Mark Triggs wrote:
> Hi Stu,
>
> Stuart Halloway writes:
> > Uncle Bob Martin, a very well-respected OO and agile guy, is learning
> > Clojure. He has posted an example [1] and asked for feedback from the
> > Clojure community. I have made
On Jul 20, 7:01 pm, Mark Engelberg wrote:
> Where is the original problem statement?
It is hidden in Powerpoint slides (http://butunclebob.com/files/
downloads/Bowling%20Game%20Kata.ppt) linked on the description of the
bowling game (http://butunclebob.com/
ArticleS.UncleBob.TheBowlingGameKata).
Very nice! I would change the :satisfies clause for underachievers so
that it does not create an ordering dependency.
You should post this over on Uncle Bob's site.
Stu
>
> Hi Stu,
>
>
> Stuart Halloway writes:
>
>> Uncle Bob Martin, a very well-respected OO and agile guy, is learning
>> Clo
Hi Stu,
Stuart Halloway writes:
> Uncle Bob Martin, a very well-respected OO and agile guy, is learning
> Clojure. He has posted an example [1] and asked for feedback from the
> Clojure community. I have made my suggestions in code [2] and will be
> writing them up shortly.
>
> Would lov
Mark,
I think your approach is clean and simple, but loses the advantage of
decomposing the problem into useful constituent parts. I have written
this up in more detail at
http://blog.runcoderun.com/post/145675117/tdd-in-a-functional-language-uncle-bobs-bowling
.
Stu
> I think you guys a
Where is the original problem statement?
On Mon, Jul 20, 2009 at 11:16 AM, Jim Oly wrote:
>
> My main concern was that the problem statement doesn't just specify
> the score function but also a roll function to accumulate the ball
> rolls.
--~--~-~--~~~---~--~~
Yo
My main concern was that the problem statement doesn't just specify
the score function but also a roll function to accumulate the ball
rolls. Obviously this will be different in Clojure since we would
prefer immutable data structures, but it feels like we're losing part
of the problem by ignoring
Sorry for the confusing choice of variable name. Should be "game" not
"games" in:
(defn score [game] (sum (take 10 (frame-scores game
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to th
Whoops, I guess I don't understand bowling scoring as well as I
thought. Now that I've read up a bit more on bowling scoring, I see
that if you get down to three rolls, (say 10, 7, 2) it must be scored
differently depending on whether it is a strike in the 9th frame
followed by 2 balls in the 10t
Hi Stuart,
Couldn't your frames function benefit from using (when) instead of (if)
(making it clear that the alternative is nil), and also, (when-let [rolls
(seq rolls)]) instead of just (when rolls), which may be more robust and
seems more idiomatic when used in conjunction with lazy-seq ?
BTW,
I think you guys are really overthinking this problem. Because
Clojure inherits Java's stack limitations, we tend to get hung up on
converting elegant recursive code into loop/recur/accumulator
structures. But here, we have a problem that we know isn't going to
blow the stack, so just think recu
Uncle Bob Martin, a very well-respected OO and agile guy, is learning
Clojure. He has posted an example [1] and asked for feedback from the
Clojure community. I have made my suggestions in code [2] and will be
writing them up shortly.
Would love to see what other folks on this list have to
14 matches
Mail list logo