Taking the dog for a walk
CoffeeScript - 324 + function call

Demo (Using Leash 10):

H(0,0) D(0,0)
H(0,-1) D(0,3)
H(-1,-1) D(0,3)
H(-1,-2) D(-1,3)
H(-1,-3) D(-4,3)
H(-1,-2) D(-4,4)
H(-1,-3) D(-5,4)
H(-1,-2) D(-2,4)
H(-1,-3) D(-2,5)
H(-1,-4) D(-2,5)
H(-1,-3) D(-3,5)
H(0,-3) D(-4,5)
H(-1,-3) D(-4,6)
H(-1,-4) D(-2,6)
H(-2,-4) D(-2,6)
H(-3,-4) D(-5,6)
H(-4,-4) D(-5,6)
H(-4,-3) D(-5,8)
H(-5,-3) D(-2,8)
H(-5,-2) D(-2,8)
H(-5,-3) D(-2,5)


Code:

w=(i)-&gt;
    [s,l]=i.split ' ';m=Math;h=[0,0];d=[0,0];r=-&gt;(4*m.random())|0
    a=-&gt;m.abs(h[0]-d[0])**2+m.abs(h[1]-d[1])**2&lt;=l**2
    b=(x)-&gt;if x%2 then 1else-1
    for i in[0..s]
        console.log "H(#{h}) D(#{d})"
        loop
            H=h.slice();x=r();h[(x/2)|0]+=b x;break if a();h=H
        D=r();x=r();(d[(x/2)|0]+=b x;d[(x/2)|0]-=b x if!a())while D--&gt;0


Long Code:

human = [ 0, 0 ]
doge = [ 0, 0 ]
randomDirection = -&gt; [ 'u', 'd', 'l', 'r' ][(4*Math.random())|0]
allowed = -&gt; Math.abs(human[0] - doge[0]) ** 2 + Math.abs(human[1] - doge[1]) ** 2 &lt;= leash**2
leash = 0
walk = (input) -&gt;
    [ seconds, leash ] = input.split ' '
    for i in [0..seconds]
        console.log "H(#{human}) D(#{doge}) #{Math.sqrt Math.abs(human[0] - doge[0]) ** 2 + Math.abs(human[1] - doge[1]) ** 2}"
        valid = no
        loop
            oldHuman = human.slice()
            switch randomDirection()
                when 'u'
                    human[0]--
                when 'd'
                    human[0]++
                when 'l'
                    human[1]--
                when 'r'
                    human[1]++

            if allowed()
                break
            else
                human = oldHuman

        dogeDistance = (Math.random() * 4)|0
        switch randomDirection()
            when 'u'
                while dogeDistance-- &gt; 0
                    doge[0]--
                    doge[0]++ if !allowed() 
            when 'd'
                while dogeDistance-- &gt; 0
                    doge[0]++
                    doge[0]-- if !allowed() 
            when 'l'
                while dogeDistance-- &gt; 0
                    doge[1]--
                    doge[1]++ if !allowed() 
            when 'r'
                while dogeDistance-- &gt; 0
                    doge[1]++
                    doge[1]-- if !allowed() 
walk "10 2"