Advertisement
Guest User

Untitled

a guest
May 31st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var up = function(current, goal) { // add types
  2.   console.log(current) // printf
  3.   if(current.length === goal) {
  4.     down(current.slice(0, -1), 0)
  5.   } else {
  6.     up(current + '0', goal)
  7.   }
  8. }
  9.  
  10. var down = function(current, goal) { // add types
  11.   console.log(current)
  12.   if(current.length !== goal) { // check how measure length in your language
  13.     down(current.slice(0, -1), goal)
  14.   }
  15. }
  16.  
  17. up('0', 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement