Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr


        

Your Answer

Running tests for hailstone...
Testing hailstone(5)
    Recursive: 5 16 8 4 2 1
    Iterative: 5 16 8 4 2 1
Testing hailstone(8)
    Recursive: 8 4 2 1
    Iterative: 8 4 2 1
Testing hailstone(14)
    Recursive: 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
    Iterative: 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
Running tests for count_digits...
Testing count_digits(2120, 2)
    Recursive:      2
    Iterative:      2
    Tail Recursive: 2
Testing count_digits(123, 7)
    Recursive:      0
    Iterative:      0
    Tail Recursive: 0
Testing count_digits(20, 0)
    Recursive:      1
    Iterative:      1
    Tail Recursive: 1
Testing count_digits(0, 8)
    Recursive:      0
    Iterative:      0
    Tail Recursive: 0
Testing count_digits(0, 0)
    Recursive:      1
    Iterative:      1
    Tail Recursive: 1

JOJ Answer

Running tests for hailstone...
Testing hailstone(5)
    Recursive: 5 16 8 4 2 1 
    Iterative: 5 16 8 4 2 1 
Testing hailstone(8)
    Recursive: 8 4 2 1 
    Iterative: 8 4 2 1 
Testing hailstone(14)
    Recursive: 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 
    Iterative: 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 
Running tests for count_digits...
Testing count_digits(2120, 2)
    Recursive:      2
    Iterative:      2
    Tail Recursive: 2
Testing count_digits(123, 7)
    Recursive:      0
    Iterative:      0
    Tail Recursive: 0
Testing count_digits(20, 0)
    Recursive:      1
    Iterative:      1
    Tail Recursive: 1
Testing count_digits(0, 8)
    Recursive:      0
    Iterative:      0
    Tail Recursive: 0
Testing count_digits(0, 0)
    Recursive:      1
    Iterative:      1
    Tail Recursive: 1