Old MacDonald by recursive

class P{static void Main(){string b=", E-I-E-I-O.\n",m="Old MacDonald had a farm"+b,o="";for(int i=0;;System.Console.WriteLine(m+"And on his farm he had a {0}With a"+o+m,"cow sheep duck pig".Split()[i++]+b),o="A"+o)o=" _-_ here, and a _-_ there.\nHere a _, there a _, everywhere a _-_.\n".Replace("_","moo baa quack oink".Split()[i]).Replace(" o","n o")+o;}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page