Re: How could you solve this problem

2013-11-18 Thread Ray Miller
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,

Re: How could you solve this problem

2013-11-15 Thread Leon Grapenthin
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

Re: How could you solve this problem

2013-11-14 Thread Leon Grapenthin
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

Re: How could you solve this problem

2013-11-14 Thread Leon Grapenthin
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. >

Re: How could you solve this problem

2013-11-14 Thread Leon Grapenthin
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

Re: How could you solve this problem

2013-11-14 Thread Leon Grapenthin
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

Re: How could you solve this problem

2013-11-14 Thread Leon Grapenthin
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

How could you solve this problem

2013-11-12 Thread Round Robin
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