fork download
  1.  
  2. def numberFour(n)
  3.  
  4. if n - 4 != 0
  5. if n % 10 == 0
  6. numberFour(n/10)
  7. end
  8. if n % 10 == 4
  9. numberFour(n/10)
  10. else
  11. numberFour(n*2)
  12. end
  13. print "---->%d"%[n]
  14. end
  15.  
  16. end
  17. n = 3
  18. print "%d"%[4]
  19. numberFour(n)
Success #stdin #stdout 0.01s 6372KB
stdin
Standard input is empty
stdout
4---->2---->24---->12---->6---->3