X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=extra%2Fproject-euler%2F215%2F215.factor;h=1006b7a4cf25de71ce0ca2d96a8af19b4fbd32e1;hp=30c42cc4be2b5855a56d90556b903f1497db8d58;hb=3f3d57032bf29190e9bee12d168a4bce6d74653c;hpb=cd1bb8f4c8afba318249c7b756a45aa1c46ea51e diff --git a/extra/project-euler/215/215.factor b/extra/project-euler/215/215.factor index 30c42cc4be..1006b7a4cf 100644 --- a/extra/project-euler/215/215.factor +++ b/extra/project-euler/215/215.factor @@ -72,14 +72,14 @@ M: end h2 dup failure? [ ] unless ; : first-row ( n -- t ) [ ] dip - 1- [| a b c | b c a b ] times 2drop ; + 1 - [| a b c | b c a b ] times 2drop ; GENERIC: total ( t -- n ) M: block total [ total ] dup choice + ; M: end total ways>> ; : solve ( width height -- ways ) - [ first-row ] dip 1- [ next-row ] times total ; + [ first-row ] dip 1 - [ next-row ] times total ; PRIVATE>