Here’s the python code:
for i in range(116000): x = i y = (x*4)/2.71 print(x, y)
Thanks (and sorry for the weird Ask HN :) )
Alternate version using while:
program hnscratch;
var i: integer;
x: real;
y: real;
i := 0;
begin;
while i <116000 do;
begin;
x := i;
y := (x*4) / 2.71;
writeln(x,y);
end;
end.
Gah formatting is horrible ... [EDIT] here is a gist: https://gist.github.com/tonetheman/db1c3d3cc8a63a0498ed3b165...
program TestMe; var i : Longint; x : Longint = 0; y : Real = 0; begin
for i:=0 to 116000 do
begin
x := i;
y := (x*4)/2.71;
end;
writeln(x,y);
end.
Program test(output); var i,x:integer; y:real; begin for i:=1 to 10 do begin x:=i; y:=(x*4)/2.71; writeln(x,y); end;
end.
program example;
var
i: integer;
x: real;
y: real;
begin
for i := 0 to 116000-1 do begin
x := i;
y := (x*4)/2.71;
println(x, y)
end
end.
The difference to note is that the Pascal FOR loop is end inclusive that is it is a closed interval rather than the half open interval that Python uses for its range.
end.