procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
var
x:integer;
begin
if presskey=true then
begin
for x:= 1 to level do
if thread[x].b0 = Key then
begin
thread[x].DoVisualSwap;
PaintBox1.Refresh;
PaintBox2.Refresh;
PaintBox3.Refresh;
exit;
end;
thread[1].er:=(thread[1].er)+1;
end;
end;