Merge pull request #637 from aquilax/patch-1

Adds Sine Wave Pascal implementation
This commit is contained in:
Jeff Atwood
2022-03-15 23:56:40 -05:00
committed by GitHub

View File

@@ -0,0 +1,35 @@
program sinewave;
procedure tabWriteLn(text: string; indent: integer);
begin
Writeln(text:length(text)+indent);
end;
var
a, t, b: integer;
begin
tabWriteLn('SINE WAVE', 30);
tabWriteLn('CREATIVE COMPUTING MORRISTOWN, NEW JERSEY', 15);
Writeln();
Writeln();
Writeln();
Writeln();
Writeln();
// REMARKABLE PROGRAM BY DAVID AHL
b := 0;
// START LONG LOOP
for t := 0 to 40*4 do
begin
a := Trunc(26+25*Sin(t/4));
if (b = 0) then
begin
tabWriteLn('CREATIVE', a);
b := 1;
end
else
begin
tabWriteLn('COMPUTING', a);
b := 0;
end;
end;
end.