[your code here] 99 bottles of beer

SrMordred patric.dexheimer at gmail.com
Mon Oct 15 15:55:41 UTC 2018


import std.format;
template Bootle(alias Beer = 0)
{
     static if(Beer < 99)
         enum Bootle = Bootle!(Beer + 1);
     else
         enum Bootle = Beer;
     pragma(msg,
		format!"%d bottles of beer on the wall, %d bottles of beer. 
Take one down, pass it around, %d bottles of beer on the wall."
		(Beer ,Beer, Beer-1)
	);

}
enum BootleBeer = Bootle!1;
void main(){}

:P


More information about the Digitalmars-d mailing list