Курсовая работа: Розробка гри Життя
else
new_gen[j,k]:=0;
end;
end;
procedure next_generation;
var
j,k,m,prev_j,next_j,prev_k,next_k:word;
begin
old_gen:=new_gen;
for j:=0 to ver do
begin
if j=0 then
prev_j:=ver
else
prev_j:=j-1;
if j=ver then
next_j:=0
else
next_j:=j+1;
for k:=0 to hor do
begin
if k=0 then
prev_k:=ver
else
prev_k:=k-1;
if k=hor then
next_k:=0
else
next_k:=k+1;