Permalink
Browse files

project-euler.150: bit faster with inline.

  • Loading branch information...
1 parent 61feee6 commit 9e41293a35e5686e51dfd28cf8a75facbfd5ffae @mrjbq7 mrjbq7 committed Sep 29, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 extra/project-euler/150/150.factor
@@ -48,7 +48,7 @@ IN: project-euler.150
615949 * 797807 + 20 2^ rem dup 19 2^ - ; inline
: sums-triangle ( -- seq )
- 0 1000 [1,b] [ [ next ] replicate partial-sums ] map nip ;
+ 0 1000 [1,b] [ [ next ] replicate partial-sums ] map nip ; inline
:: (euler150) ( m -- n )
sums-triangle :> table
@@ -57,12 +57,10 @@ IN: project-euler.150
m x - iota [| z |
x z + table nth-unsafe
[ y z + 1 + swap nth-unsafe ]
- [ y swap nth-unsafe ] bi -
+ [ y swap nth-unsafe ] bi -
] partial-sum-infimum
] map-infimum
- ] map-infimum ;
-
-HINTS: (euler150) fixnum ;
+ ] map-infimum ; inline
PRIVATE>

0 comments on commit 9e41293

Please sign in to comment.