Yours_To_Discover: A Ontario Code Poem in Pascal
editInspired by the classic 1990 Larry Wall poem "Black Perl", ** Yours_To_Discover:** is a valid, compilable Pascal program written to read like poetry while outputting a tribute to Ontario when executed.
program Yours_To_Discover;
var
shield, lakes, mist, horizon: boolean;
seasons, pines, miles, rapids: integer;
procedure echo(breeze: string); begin writeln(breeze); end;
procedure paddle(further: integer); begin miles := miles + further; end;
procedure watch(sky: string); begin writeln(sky); end;
procedure come_home; begin echo('...a place to stand, a place to grow.'); halt; end;
begin
shield := true; lakes := true;
mist := false; horizon := not mist;
miles := 0; rapids := 4;
echo('from the thunder of Niagara:');
for seasons := 1 to 3 do
begin
paddle(seasons);
case seasons of
1: echo(' trilliums wake on the forest floor,');
2: echo(' canoes cut glass across Muskoka,');
3: echo(' Algonquin burns in crimson and gold.');
end;
end;
if (shield and lakes) then
watch('granite cliffs guard the northern shore.');
repeat
rapids := rapids - 1;
if rapids = 3 then echo('past the towers rising by Ontario''s shore,');
if rapids = 2 then echo('along the frozen canal of Ottawa,');
if rapids = 1 then echo('up to the wild waters of Hudson Bay...');
until (rapids <= 0) or mist;
while (shield and horizon) do
begin
pines := pines + 1;
if miles > 0 then
begin
lakes := true;
come_home;
end;
end;
end.
from the thunder of Niagara:
trilliums wake on the forest floor,
canoes cut glass across Muskoka,
Algonquin burns in crimson and gold.
granite cliffs guard the northern shore.
past the towers rising by Ontario's shore,
along the frozen canal of Ottawa,
up to the wild waters of Hudson Bay...
...a place to stand, a place to grow.