Remove roll from Project Euler problem 33 solution
parent
9b6d4f05f5
commit
adac92dfa5
|
@ -33,7 +33,7 @@ IN: project-euler.033
|
|||
10 99 [a,b] dup cartesian-product [ first2 < ] filter ;
|
||||
|
||||
: safe? ( ax xb -- ? )
|
||||
[ 10 /mod ] bi@ -roll = rot zero? not and nip ;
|
||||
[ 10 /mod ] bi@ [ = ] dip zero? not and nip ;
|
||||
|
||||
: ax/xb ( ax xb -- z/f )
|
||||
2dup safe? [ [ 10 /mod ] bi@ 2nip / ] [ 2drop f ] if ;
|
||||
|
|
Loading…
Reference in New Issue