Language Turing
(Ontario's default high school language)
Date: | 03/21/06 |
Author: | Bill Huang |
URL: | n/a |
Comments: | 4 |
Info: | n/a |
Score: | ![]() |
% Bill Huang huan3816@email.adsb.on.ca % Turing language version of 99 bottles of beer loop for decreasing i : 99 .. 1 put i, " bottle(s) of beer on the wall, ", i, " bottle(s) of beer" put "Take one down, pass it around, ", i - 1, " bottle(s) of beer on the wall" delay (300) end for put "No more bottles of beer on the wall, no more bottles of beer." put "Go to the store and buy some more, 99 bottles of beer on the wall." delay (2000) end loop
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
if (bottles >= 2) then
put bottles, " bottles of beer on the wall, ", bottles, " bottles of beer."
if (bottles not= 2) then
put "Take one down and pass it around, ", (bottles - 1), " bottles of beer on the wall.\n"
else
put "Take one down and pass it around, 1 bottle of beer on the wall.\n"
end if
elsif (bottles = 1) then
put "1 bottle of beer on the wall, 1 bottle of beer."
put "Take one down and pass it around, no more bottles of beer on the wall.\n"
else
put "No more bottles of beer on the wall, no more bottles of beer."
put "Go to the store and buy some more, 99 bottles of beer on the wall."
end if
end for
expression or two. Geez Louise..........