Display a linear combination: Difference between revisions

m
→‎{{header|Factor}}: use when-empty instead of several other words
(Added Factor)
m (→‎{{header|Factor}}: use when-empty instead of several other words)
Line 393:
: linear-combo ( seq -- str )
[ choose-term ] map-index harvest " + " join
R/ \+ -/ "- " re-replace dup empty? [ drop "0" ] when-empty ;
{ { 1 2 3 } { 0 1 2 3 } { 1 0 3 4 } { 1 2 0 } { 0 0 0 } { 0 }
1,827

edits