! Copyright (c) 2008 Eric Mertens.
! See http://factorcode.org/license.txt for BSD license.
-USING: arrays assocs kernel locals math math.order math.ranges sequences project-euler.common ;
+USING: arrays assocs kernel math math.order ranges sequences project-euler.common ;
IN: project-euler.076
! http://projecteuler.net/index.php?section=problems&id=76
<PRIVATE
: init ( n -- table )
- [1,b] [ 0 2array 0 ] H{ } map>assoc
+ [1..b] [ 0 2array 0 ] H{ } map>assoc
1 { 0 0 } pick set-at ;
: use ( n i -- n i )
] if ;
:: each-subproblem ( n quot -- )
- n [1,b] [ dup [1,b] quot with each ] each ; inline
+ n [1..b] [ dup [1..b] quot with each ] each ; inline
: (euler076) ( n -- m )
dup init