SHARE
TWEET

Untitled

a guest Apr 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function addOneBit(v1, v2) {
  2.   return halfAdder(v1, v2);
  3. }
  4.  
  5. [[0, 0], [0, 1], [1, 0], [1, 1]].map(v =>
  6.   console.log(`addOneBit(${v[0]}, ${v[1]})`, addOneBit(v[0], v[1]))
  7. );
  8.  
  9. // result
  10. // addOneBit(0, 0) { c: 0, s: 0 }
  11. // addOneBit(0, 1) { c: 0, s: 1 }
  12. // addOneBit(1, 0) { c: 0, s: 1 }
  13. // addOneBit(1, 1) { c: 1, s: 0 }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top