Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Euler probl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 12 Topic 4022 of 4173
Post > Topic >>

Re: Euler problem #22

by Albert van der Horst <albert@[EMAIL PROTECTED] > Apr 30, 2008 at 08:19 AM

In article
<af50505e-1bb8-40c4-beae-5e2671ca71d4@[EMAIL PROTECTED]
>,
Slava Pestov  <slava@[EMAIL PROTECTED]
> wrote:
>On Apr 29, 4:30=A0pm, Jonah Thomas <jethom...@[EMAIL PROTECTED]
> wrote:
>> Oh well. We don't mind useing RPN, or a data stack, or weak typing.
>
>You don't have to give up RPN or the stack to solve this problem in a
>concise way. Here is the Factor solution:
>
>: alpha-value ( str -- n )
>    >lower [ CHAR: a - 1+ ] sigma ;
>
>: source-022 ( -- seq )
>    "resource:extra/project-euler/022/names.txt"
>    ascii file-contents [ quotable? ] filter "," split ;
>
>: name-scores ( seq -- seq )
>    [ 1+ swap alpha-value * ] map-index ;
>
>: euler-022 ( -- answer )
>    source-022 natural-sort name-scores sum ;
>
>We have solutions to about 70 project euler problems so far, and most
>of them are very short:

Nice! I would be interested in the running time on a machine
where Marcel Hendrix uses up 5 mS (and hundreds of WOC).

Has somebody both factor and iforth installed?

>http://factorcode.org/responder/cgi/gitweb.cgi?p=3Dfactor.git;a=3Dtree;f=3De=
>xtra/project-euler;h=3Dc5ba0c4ac8b33de81d0030cbd5abce2ac990e7fa;hb=3DHEAD

Where do these ugly urls come from?

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@[EMAIL PROTECTED]
 &=n http://home.hccnet.nl/a.w.m.van.der.horst
 




 12 Posts in Topic:
Euler problem #22
mhx@[EMAIL PROTECTED] (M  2008-04-27 14:29:26 
Re: Euler problem #22
William James <w_a_x_m  2008-04-27 13:51:04 
Re: Euler problem #22
William James <w_a_x_m  2008-04-29 08:31:00 
Re: Euler problem #22
Andrew Haley <andrew29  2008-04-29 12:34:13 
Re: Euler problem #22
mhx@[EMAIL PROTECTED] (M  2008-04-29 20:44:53 
Re: Euler problem #22
Bruce McFarling <agila  2008-04-29 11:35:03 
Re: Euler problem #22
Slava Pestov <slava@[E  2008-04-29 20:57:36 
Re: Euler problem #22
mhx@[EMAIL PROTECTED] (M  2008-04-30 09:34:59 
Re: Euler problem #22
Zev Weiss <i_dance_on_  2008-04-30 08:05:58 
Re: Euler problem #22
mhx@[EMAIL PROTECTED] (M  2008-04-30 10:59:09 
Re: Euler problem #22
Albert van der Horst <  2008-04-30 08:19:44 
Re: Euler problem #22
Jonah Thomas <jethomas  2008-04-29 17:30:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:21:32 CDT 2008.