diff options
Diffstat (limited to 'tests/nadder.mj')
-rw-r--r-- | tests/nadder.mj | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/nadder.mj b/tests/nadder.mj index 0c95386..b75a83c 100644 --- a/tests/nadder.mj +++ b/tests/nadder.mj @@ -6,14 +6,14 @@ end where adder<n>(a:[n], b:[n], c_in) = (o:[n], c_out) where if n = 0 then o = []; - c_out = 0 + c_out = c_in else - (s_n1, c_n1) = adder<n-1>(a[1..], b[1..], c_in); - (s_n, c_out) = fulladder(a[0], b[0], c_n1); + (s_n, c_n1) = fulladder(a[0], b[0], c_in); + (s_n1, c_out) = adder<n-1>(a[1..], b[1..], c_n1); o = s_n . s_n1 end if end where -main(a, b) = (o, c) where - (o, c) = adder<1>(a,b,0) -end where
\ No newline at end of file +main(a:[4], b:[4]) = (o:[4], c) where + (o, c) = adder<4>(a,b,0) +end where |