logic.examples.money: use lnth and leach.

master
John Benediktsson 2020-05-16 11:26:16 -07:00
parent 457485dae7
commit abb1755311
1 changed files with 5 additions and 5 deletions

View File

@ -46,15 +46,15 @@ LOGIC-VARS: S E N D M O R Y A L G B T
:: S-and-M-can't-be-zero ( seq -- seq' ) :: S-and-M-can't-be-zero ( seq -- seq' )
seq [| hash | seq [| hash |
1 hash N1 of list>array nth 0 = not 1 hash N1 of lnth 0 = not
1 hash N2 of list>array nth 0 = not and 1 hash N2 of lnth 0 = not and
] filter ; ] filter ;
:: print-puzzle ( hash-array -- ) :: print-puzzle ( hash-array -- )
hash-array hash-array
[| hash | [| hash |
" " printf hash N1 of list>array [ "%d " printf ] each nl " " printf hash N1 of [ "%d " printf ] leach nl
"+ " printf hash N2 of list>array [ "%d " printf ] each nl "+ " printf hash N2 of [ "%d " printf ] leach nl
"----------------" printf nl "----------------" printf nl
" " printf hash N of list>array [ "%d " printf ] each nl nl " " printf hash N of [ "%d " printf ] leach nl nl
] each ; ] each ;