Just for contrast, here's a fairly succinct solution I put together:
https://gist.github.com/ray1729/7534528#file-ring_of_primes-clj
It uses a basic depth-first search.
Ray.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group,
Round Robin: In case you are new to Clojure, I have written extended
commentary of my implementation here:
http://programmers.stackexchange.com/questions/194487/ring-of-numbers-where-adjacent-entries-sum-up-to-a-prime/218470#218470,
were somebody else asked about the problem in April.
On Tuesd
Edited version with more code-cleanup (got rid of result symbol):
https://www.refheap.com/20882
I have finally managed to register to refheap and will keep this one
updated in case I make more changes. That problem you have posted can
really keep your head spinning if you want to implement it in
I have now modified the implementation so that it generates all possible
rings for any given length as a lazy sequence.
On Thursday, November 14, 2013 7:19:37 PM UTC+1, Leon Grapenthin wrote:
>
> Ah, I just saw the exercise demands all possible rings to be printed which
> quite spams the REPL.
>
Ah, I just saw the exercise demands all possible rings to be printed which
quite spams the REPL.
Here is a modified version that does that
https://www.refheap.com/20871
On Tuesday, November 12, 2013 11:39:18 PM UTC+1, Round Robin wrote:
>
> Can anyone help me solving this problem in clojure 1196
Corrected version link: https://www.refheap.com/20869
On Thursday, November 14, 2013 5:42:31 PM UTC+1, Leon Grapenthin wrote:
>
> Here you go:
> https://www.refheap.com/20868
>
> On Tuesday, November 12, 2013 11:39:18 PM UTC+1, Round Robin wrote:
>>
>> Can anyone help me solving this problem in cl
Here you go:
https://www.refheap.com/20868
On Tuesday, November 12, 2013 11:39:18 PM UTC+1, Round Robin wrote:
>
> Can anyone help me solving this problem in clojure 1196 - Ring of Primes
> http://coj.uci.cu/24h/problem.xhtml?abb=1196
>
--
--
You received this message because you are subscribe
Can anyone help me solving this problem in clojure 1196 - Ring of Primes
http://coj.uci.cu/24h/problem.xhtml?abb=1196
--
--
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 fr