// TADS 3 (Text Adventure Development System) is a language // for crafting interactive fiction. More information can // be found at http://www.tads.org/. // 99 bottles of beer on the wall. // 17 June 2002 Jim Nelson main(args) { local bottles = 99; local number = bottles; local plural = 's'; for(;;) { "<> bottle<> of beer on the wall,\n"; "<> bottle<> of beer,\n"; if(bottles == 0) { break; } "Take <<(bottles != 1) ? 'one' : 'it'>> down, pass it around,\n"; bottles--; if(bottles > 1) { plural = 's'; number = bottles; } else if(bottles == 1) { plural = ''; number = 'One more'; } else { // zero plural = 's'; number = 'No more'; } "<> bottle<> of beer on the wall.\n\b"; } "Go to the store, buy some more,\n"; "99 bottles of beer on the wall.\n\b"; }