I'm tired, but I can't seem to fall asleep. Help me count sheep.
Given an input N (positive integer), make N sheep jump over an ascii fence, like the sample below. Only one frame should be displayed at once:
o |-|
──|-|── 0
o|-|
──|-|── 0
o
|-|
──|-|── 0
|-|o
──|-|── 0
|-| o
──|-|── 0
o |-|
──|-|── 1
o|-|
──|-|── 1
o
|-|
──|-|── 1
Count should be kept at the lower right side of the 'ground'. Trailing and leading whitespace and newlines are allowed. If your language of choice has difficulty clearing the screen for each frame you can add sufficient newlines to clear the screen - please state how many lines you add for this in your answer. The program should terminate when the N'th sheep is on the fifth floortile.
I need to get up early tomorrow, so shortest code in bytes wins. Please submit a function or complete program. Standard loopholes apply.
N=3
the last frame will contain a sheep at the right end and the counter will still say2
. Is that correct? \$\endgroup\$