# LDPL 99 Bottles of Beer # by Martin del Rio # https://www.ldpl-lang.org/ # Created for LDPL 1.0 DATA: bottles-in-the-wall is number plural is text PROCEDURE: store 99 in bottles-in-the-wall sub-procedure check-plural if bottles-in-the-wall is not equal to 1 then store "s" in plural else store "" in plural end if end sub-procedure while bottles-in-the-wall is greater than 0 do call sub-procedure check-plural display bottles-in-the-wall " bottle" plural " of beer on the wall," crlf display bottles-in-the-wall " bottle" plural " of beer." crlf display "Take one down, pass it around," crlf in bottles-in-the-wall solve bottles-in-the-wall - 1 call sub-procedure check-plural if bottles-in-the-wall is greater than 0 then display bottles-in-the-wall " bottle" plural " of beer on the wall." crlf crlf else display "No bottles of beer on the wall." crlf end if repeat