code

54 views
Skip to first unread message

Brian Lewis

unread,
Oct 14, 2010, 5:48:22 PM10/14/10
to gainesvil...@googlegroups.com
Just to get stuff going on, let's do Project Euler #1.

Whenever we code, please make your solutions as perfect as they can be.
Realize what choices you're making, and have reasons for your decisions.
After you think you've made every byte as good as you know how to make
it, put it on hpaste. Then we can talk strategy, style, naming,
efficiency, etc.

Brian Lewis

unread,
Oct 14, 2010, 7:31:13 PM10/14/10
to gainesvil...@googlegroups.com
On Thursday, 14.10.10 at 17:48, Brian Lewis wrote:
> Just to get stuff going on, let's do Project Euler #1.

Be sure your code is the best, and hpaste it, before looking at this.

http://hpaste.org/40583/project_euler_1

Ian Taylor

unread,
Oct 15, 2010, 1:39:31 PM10/15/10
to gainesvil...@googlegroups.com
I read Johan Tibell's cufp presentation and thought I'd apply some of that here.
http://github.com/tibbe/cufp-2010

My solutions are here:
http://hpaste.org/40600/project_euler_1

The hpaste has information about running criterion benchmarks.

Ian Taylor

unread,
Oct 15, 2010, 5:35:20 PM10/15/10
to gainesvil...@googlegroups.com
Ian, you should think more carefully about problems before solving them.

Less elegant, but direct.

http://hpaste.org/40609/more_like

Brian Lewis

unread,
Oct 18, 2010, 11:44:34 AM10/18/10
to gainesvil...@googlegroups.com
Ayyo, anybody else going to give this a try? Should we start talking
about the solutions?

Francesco Lazzarino

unread,
Oct 18, 2010, 12:23:00 PM10/18/10
to gainesvil...@googlegroups.com
sorry guys i'll try, i've been really busy all day and all other work days. i'm giving it a try after lunch


On Mon, Oct 18, 2010 at 11:44 AM, Brian Lewis <br...@lorf.org> wrote:
Ayyo, anybody else going to give this a try? Should we start talking
about the solutions?



--
franco

Christian von Kleist

unread,
Oct 18, 2010, 2:40:19 PM10/18/10
to gainesvil...@googlegroups.com
Here is my super-crappy code:

http://hpaste.org/40680/pe1

I could only spend a little time on this one. Sorry!

On Thu, Oct 14, 2010 at 5:48 PM, Brian Lewis <br...@lorf.org> wrote:

Francesco Lazzarino

unread,
Oct 19, 2010, 8:52:53 AM10/19/10
to gainesvil...@googlegroups.com

Francesco Lazzarino

unread,
Oct 19, 2010, 8:55:42 AM10/19/10
to gainesvil...@googlegroups.com
oops, on hpaste: http://hpaste.org/40710/project_euler_1
--
franco

Francesco Lazzarino

unread,
Oct 19, 2010, 2:03:51 PM10/19/10
to gainesvil...@googlegroups.com

Christian von Kleist

unread,
Oct 19, 2010, 2:37:48 PM10/19/10
to gainesvil...@googlegroups.com
While working on #2, I saw this in the output of my fib function.
fib.png

Francesco Lazzarino

unread,
Oct 19, 2010, 2:39:08 PM10/19/10
to gainesvil...@googlegroups.com
wow, bad-ass
--
franco

Francesco Lazzarino

unread,
Oct 20, 2010, 9:24:29 AM10/20/10
to gainesvil...@googlegroups.com
#3 http://gist.github.com/636387

it took me a while to get my algorithm down to a reasonable runtime.
--
franco

Francesco Lazzarino

unread,
Oct 20, 2010, 10:36:42 AM10/20/10
to gainesvil...@googlegroups.com
#4 http://gist.github.com/636534

i'm not trying to brown nose by going far ahead, i might not have a change to work on these later so i'm taking advantage of it.
--
franco

Ian Taylor

unread,
Oct 20, 2010, 4:05:02 PM10/20/10
to gainesvil...@googlegroups.com
Your #3 has problems for small n.
***Exception: Prelude.maximum: empty list


On Wed, Oct 20, 2010 at 9:24 AM, Francesco Lazzarino

Francesco Lazzarino

unread,
Oct 20, 2010, 4:59:24 PM10/20/10
to gainesvil...@googlegroups.com

Francesco Lazzarino

unread,
Oct 20, 2010, 5:00:45 PM10/20/10
to gainesvil...@googlegroups.com
probably because of this: [2..(n - 1)] (line 10)

On Wed, Oct 20, 2010 at 4:05 PM, Ian Taylor <ibta...@gmail.com> wrote:



--
franco
Reply all
Reply to author
Forward
0 new messages