pseudo ai

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
program plat;
uses
GraphABC;
var
x, y, randomX, randomY: integer;
kx, ky,rX,rY,ranX,ranY: real;
procedure Moving;
begin;
kx := (randomX - x) / 500;ky := (randomY - y) / 500;
if kx<2 then kx:=(randomX - x) / 1.9;
if ky<2 then ky:= (randomY - y) / 1.9;
x := round(x + kx);
y := round(y + ky);
if x=randomX then begin
if y=randomY then begin
randomX:=random(640);
randomY:=random(480);
end;
end;
end;
procedure Drawing;
begin;
Rectangle(0,0,640,480);
lineto(x, y, clred);
putpixel(randomX, randomY, clblack);
sleep(35);
end;
begin
randomize;
x := 1;y := 1;randomX := random(640);randomY := random(480);
for var i := 1 to 99999999999 do
begin
Moving;LockDrawing; Drawing; Redraw;
end;
end.