Old MacDonald function Create a function in your chosen language that prints out the following:

Old MacDonald had a farm, E-I-E-I-O,
And on that farm he had a cow, E-I-E-I-O,
With a moo moo here and a moo moo there,
Here a moo, there a moo, everywhere a moo moo,
Old MacDonald had a farm, E-I-E-I-O!


Where cow and moo are strings in the function parameters, and as such, can be changed to pig and oink or sheep and baa, for example.

It should take into account capital letters, hyphens, punctuation, spaces and line breaks.

Aim to type the fewest amount of Unicode characters in your code.
Javascript ES6 - 204


  Aim to type the fewest amount of Unicode characters in your code.


Not the shorter but probably the most obfuscated.

f=(a,b)=&gt;{for(c=[b,a].concat('!,-ADEHIMOWacdefhilmnortvwy \n'.split(o='')),i=62;i;o+=c[e&gt;&gt;10]+c[e/32&amp;31]+c[e&amp;31])e='ⱞᄤ⒇瓤抣瘭㾭癍㚏᫶⦮函࿋Π疽䌐獲樘ྰ㞠戝晐}疽䌐࿈䌐眲Π疽㛏戝癐Π疽伲࿌⒋ფᲉѽ疽䦯䨝抽瘭䦹容㾷碶ᅣᲉᄤྦྷ㜕㞱㗽㾲妴㣗畍⺏'.charCodeAt(--i);alert(o)}


If your browser do not support ES6 :

function f(a,b){for(c=[b,a].concat('!,-ADEHIMOWacdefhilmnortvwy \n'.split(o='')),i=62;i;o+=c[e&gt;&gt;10]+c[e/32&amp;31]+c[e&amp;31])e='ⱞᄤ⒇瓤抣瘭㾭癍㚏᫶⦮函࿋Π疽䌐獲樘ྰ㞠戝晐}疽䌐࿈䌐眲Π疽㛏戝癐Π疽伲࿌⒋ფᲉѽ疽䦯䨝抽瘭䦹容㾷碶ᅣᲉᄤྦྷ㜕㞱㗽㾲妴㣗畍⺏'.charCodeAt(--i);alert(o)}


Copy/Paste that code into your browser console and try f('cow','moo'), f('pig','oink'), f('sheep','baa')

How it works ?

c is an array of 29 letters plus the animal and its sound (let call this our alphabet).
So, all the 31 characters fit in 5 bits (2^5 = 32).
A Unicode character is 16 bits long, so it can encode 3 characters of our alphabet with a padding bit.
The full text with the new lines is 186 characters of our alphabet, it can be encoded with 62 Unicode characters.  

For example, Old is encoded like this :

alphabet value         O      l      d
alphabet index         11     20     15
unicode           0  01011  10100  01111  ===&gt; \u2e8f (⺏)


If you have troubles to read some Unicode chars, install Code2000 font