News for hackers. Stuff that matters.
Re:Can you solve it? The Greplin programming challenge by 1amzave on Friday October 08, 2010 @04:02PM (#1773127)
So what languages did everyone use?

I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.

Re:Can you solve it? The Greplin programming challenge by sisk on Friday October 08, 2010 @05:37PM (#1773507)
JavaScript. I had my browser open ... it seemed like the logical place. :)
Re:Can you solve it? The Greplin programming challenge by lisper on Friday October 08, 2010 @08:09PM (#1773936)
Common Lisp of course :-)
Re:Can you solve it? The Greplin programming challenge by ismarc on Friday October 08, 2010 @07:33PM (#1773855)
I used Haskell for the first one (was my first actual Haskell program, everything before was just xmonad config), C for the second one (already had the needed code for generating fibonacci sequences and a prime number sieve from when I went through the euler problems using only ANSI C) and Perl for the last one. I initially used Data::PowerSet for the Perl code, but decided to write my own after it took several minutes to build the combinations and I discovered that I had the wrong answer because I improperly read the problem.

I should note that I used the existing C code I had because I had no idea where they would intersect and didn't feel like writing Yet Another Arbitrarily Large Integer Handler.

Re:Can you solve it? The Greplin programming challenge by nene on Friday October 08, 2010 @04:28PM (#1773228)
Ruby was my main choice + some command line tools to do bits of extra work, like 'sort' to find the largest palindrome and 'wc' to count the results in last exercise, and even Python command line to just manually sum the primes in second exercise.
Re:Can you solve it? The Greplin programming challenge by djacobs on Friday October 08, 2010 @06:13PM (#1773641)
Ruby has Array#sort, no command line required.
Re:Can you solve it? The Greplin programming challenge by Twisol on Friday October 08, 2010 @05:02PM (#1773375)
I used Lua, myself. I briefly considered using a more featureful language like Ruby, but I'm happy to say that Lua did the job just fine. I made good use of coroutines for the second and third problems.
Re:Can you solve it? The Greplin programming challenge by callahad on Friday October 08, 2010 @04:55PM (#1773348)
Python, Scheme, Python. Mainly because I had nice functions in Scheme for level 2 sitting around from when I was trying to work through SICP...
Re:Can you solve it? The Greplin programming challenge by cygwin98 on Thursday October 14, 2010 @03:32PM (#1792256)
I know I'm late to the party, :) I used Ruby 1.9.2. It's funny that it's the first time I used the combination generation method built in Ruby Array. The whole three questions took me about a bit more than 20 minutes, a bit longer than I thought tho.
Re:Can you solve it? The Greplin programming challenge by sendos on Saturday October 09, 2010 @04:04AM (#1774640)
Matlab for all three parts.

Quick and dirty solutions here: http://gist.github.com/618006

Re:Can you solve it? The Greplin programming challenge by leif on Friday October 08, 2010 @11:41PM (#1774284)
I'm wonderfully amazed that coreutils has factor.
Re:Can you solve it? The Greplin programming challenge by tef_ on Saturday October 09, 2010 @01:25PM (#1775364)
Python for 1,2 with a little bit of manual pasting into wolfram alpha

And for part 3 I used prolog. About ~6 lines or so.

Re:Can you solve it? The Greplin programming challenge by nomurrcy on Friday October 08, 2010 @04:54PM (#1773344)
Clojure here.
Re:Can you solve it? The Greplin programming challenge by djacobs on Friday October 08, 2010 @06:20PM (#1773657)
Mind posting your solution as a Gist? I want to see how to do level 1 without explicit loops or variables.
Re:Can you solve it? The Greplin programming challenge by nomurrcy on Monday October 11, 2010 @04:15PM (#1781063)
Sure, sorry about the delay.

http://gist.github.com/621130

I can't take credit for the solution I posted though.

I originally wrote a naive O(N^2) complexity solution (which was much shorter and was fine for the length of the input) I had this palindrome code in my 'toolbox' of code I've come across though, I'm afraid I don't know the orig author.

I just tweaked it as this is more in line with the type of example you're looking for.

Re:Can you solve it? The Greplin programming challenge by djacobs on Tuesday October 19, 2010 @11:01PM (#1809777)
Interesting, I'll have to go over your code fairly carefully, as I'm not familiar with every technique you're using here for performance.

I've since learned a good deal about Clojure and implemented an idiomatic (but probably less performant) version, for anyone interested in how short this can be:

http://gist.github.com/635674

Re:Can you solve it? The Greplin programming challenge by Natsu on Saturday October 09, 2010 @01:29AM (#1774418)
Perl. From the look of this thread, I guess everyone else has moved on?
Re:Can you solve it? The Greplin programming challenge by colomon on Saturday October 09, 2010 @04:14PM (#1775747)
I solved all three in Perl 6... ;)
Re:Can you solve it? The Greplin programming challenge by grigory on Friday October 08, 2010 @08:20PM (#1773958)
Python here - very quick to code in if you have terminal handy.
Re:Can you solve it? The Greplin programming challenge by aristidb on Saturday October 09, 2010 @08:42AM (#1774916)
Haskell for all. Perfect fit.
Re:Can you solve it? The Greplin programming challenge by afshin on Saturday October 09, 2010 @11:45AM (#1775170)
k, javascript, javascript

None of my solutions were particularly elegant :-)

Re:Can you solve it? The Greplin programming challenge by whimsy on Sunday October 10, 2010 @04:02PM (#1777808)
No Erlang?!
Re:Can you solve it? The Greplin programming challenge by p01nd3xt3r on Friday October 08, 2010 @05:55PM (#1773580)
c / python