#!perl -lp
@@{zeontwthfofisiseeiniteelm=~/..?/g,a,b}=(0..11,6,3,9);@:=map'*100'x/^h/||/a|m|b/&&")*1e$@{$&}+("||'+'.1x/lv|.te/.@@{/../,$&}.0 x/y/,/\w+/g;$_=eval"(@:)";1while s/\B...(,|$)/,$&/
|
#!perl -lp
@a{zeontwthfofisiseeiniteelm=~/..?/g,a,b}=(0..11,6,3,9);@_=map'*100'x/^h/||/a|m|b/&&")*1e$a{$&}+("||'+'.1x/lv|een/.(/../,$a{$&}).0 x/y/,/\w+/g;$_=eval"(@_)";1while s/\B...(,|$)/,$&/
|
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,a,'m',b}=(0..11,3,6,9);@_=map{"*100"x/^h/||/a|m|b/&&")*1e$a{$&}+("||"+".1x/lv|een/.(/../,$a{$&}).0 x/y/}/\w+/g;$_=eval"(@_)";1while s/\B...(,|$)/,$&/
|
two chars and one step ahead this time ;-)
by 0.03
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,a,'m',b}=(0..11,2,3,6,9);map{/^h|a|m|b/?$n.=0 x$a{$&}:(/../,$n+=$a{$&}.0 x/y/+10*/lv|een/);$N+=$n,$n=0if/[amb]/}/\w+/g;$_=$N+$n;1while s/\B...(,|$)/,$&/
|
one day, one character?
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,a,'m',b}=(0..11,2,3,6,9);map{/^h|a|m|b/?$n.=0 x$a{$&}:(/../,$n+=$a{$&}.0 x/y/+10*/lv|een/);$N+=$n,$n=0if/[amb]/}/\w+/g;$_=$N+$n;1while s/\B\d{3}(,|$)/,$&/
|
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,a,'m',b}=(0..11,2,3,6,9);for$n(split/on |nd /){/^h|a|m|b/?$n.=0 x$a{$&}:/../?$n+=$a{$&}.0 x/y/+10*/lv|een/:0for$n=~/\w+/g;$_+=$n}1while s/\B\d{3}(,|$)/,$&/
|
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,a,'m',b}=(0..11,2,3,6,9);for$n(split/on |nd /){/^h|a|m|b/?$n.=0 x$a{$&}:/../?$n+=$a{$&}.0 x/y/+10*/lv|een/:0for$n=~/\w+/g;$_+=$n}1while s/(\d+)(\d{3})/$1,$2/
|
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,tho,'m',b}=(0..11,2,3,6,9);map{/^(h|tho|m|b)/?$n.=0 x$a{$&}:/../?$n+=$a{$&}.0 x/y/+10*/lv|een/:0for/\w+/g;$N+=$n,$n=0}split/on |nd /;$_=$N;1while s/(\d+)(\d{3})/$1,$2/
|
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,tho,'m',b}=(0..11,2,3,6,9);map{$n=0;/^(h|tho|m|b)/?$n.=0 x$a{$&}:/../?$n+=$a{$&}.0 x/y/+10*/lv|een/:0for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/(\d+)(\d{3})/$1,$2/
|
#!perl -lp
@a{zeontwthfofisiseeiniteel=~/../g,h,tho,'m',b}=(0..11,2,3,6,9);map{$n=0;/^(h|tho|m|b)/?$n.=0 x$a{$&}:/^../?$n+=$a{$&}*10**/y/+10*/lv|een/:0for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/(\d+)(\d{3})/$1,$2/
|
#!perl -lp
$"="|";@a{zeontwthfofisiseeiniteel=~/../g,@b=qw/h tho m b/}=(0..11,2,3,6,9);map{$n=0;/^@b/?$n.=0 x$a{$&}:/^../?$n+=$a{$&}*10**/y/+10*/lv|een/:0for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/(\d+)(\d{3})/$1,$2/
|
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/,@b=qw/h tho m b/}=(0..11,2,3,6,9);map{$n=0;/^@b/?$n.=0 x$a{$&}:/^@a/?$n+=$a{$&}*10**/y/+10*/lv|een/:0for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/(\d+)(\d{3})/$1,$2/
|
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/}=0..11;@b{@b=qw/h tho m b/}=(2,3,6,9);map{$n=0;/^@b/?$n.=0 x$b{$&}:/^@a/?$n+=$a{$&}*10**/y/+10*/lv|een/:1for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/^(\d+)(\d{3})/$1,$2/
|
simple rearrangement
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/}=0..11;@b{@b=qw/h tho m b/}=(2,3,6,9);map{$n=0;/^@b/?$n*=10**$b{$&}:/^@a/?$n+=$a{$&}*10**/y$/+10*/lv|een/:1for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/^(\d+)(\d{3})/$1,$2/
|
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/}=0..11;@b{@b=qw/h tho m b/}=(2,3,6,9);s/(.*?) (\w+(nd|on)\b)/+($1)$2/g;s!\w+!$_=$&;/^@b/?"*1e$b{$&}":/^@a/?"+".($a{$&}*10**/y/+10*/lv|een/):""!ge;$_=eval;1while s/^(\d+)(\d{3})/$1,$2/
|
New method, but, is worse than my other. Let's see if I can improve on this.
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/}=0..11;@b{@b=qw/h tho m b/}=(2,3,6,9);s/(.*?) (\w*(nd|on)\b)/+($1)$2/g;s!\w+!$_=$&;/^@b/?"*1e$b{$&}":/^(@a)/?"+".($a{$+}*10**/y$/+10*/lv|een/):""!ge;$_=eval;1while s/^(\d+)(\d{3})/$1,$2/
|
minor improvements.
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/}=0..11;@b{@b=qw/h t m b/}=(2,3,6,9);map{$n=0;/^(@a)/&&!/[ad]$/?$n+=$a{$+}*10**/y$/+10*/lv|een/:/^@b/?$n*=10**$b{$&}:1for/\w+/g;$N+=$n}split/(?:on|nd) /;$_=$N;1while s/^(\d+)(\d{3})/$1,$2/
|
ugly. but it's a start.
Yanick said the same thing, and his is 100 characters longer
#!perl -lp
$"="|";@a{@a=qw/z o tw th fo fi si se ei n te el/}=0..11;@b{@b=qw/h t m b/}=(2,3,6,9);
map{$n=0;/^(@a)/&&!/[ad]$/?$n+=$a{$+}*(/y$/?10:1)+(/(lve|een)$/?10:0):/^@b/?$n*=10**$b{$&}:1for/\w+/g;$N+=$n}split/(?:on|nd) /;
$_=$N;1while s/^(\d+)(\d{3})/$1,$2/
|