Код
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;
type
TForm1 = class(TForm)
GroupBox2: TGroupBox;
buttonmap11: TButton;
buttonmap12: TButton;
buttonmap13: TButton;
buttonmap14: TButton;
buttonmap15: TButton;
buttonmap16: TButton;
Buttonmap17: TButton;
Buttonmap18: TButton;
Buttonmap19: TButton;
Buttonmap110: TButton;
Buttonmap21: TButton;
Buttonmap22: TButton;
Buttonmap23: TButton;
Buttonmap24: TButton;
Buttonmap25: TButton;
Buttonmap26: TButton;
Buttonmap27: TButton;
Buttonmap28: TButton;
Buttonmap29: TButton;
Buttonmap210: TButton;
Buttonmap31: TButton;
Buttonmap32: TButton;
Buttonmap33: TButton;
Buttonmap34: TButton;
Buttonmap35: TButton;
Buttonmap36: TButton;
Buttonmap37: TButton;
Buttonmap38: TButton;
Buttonmap39: TButton;
Buttonmap310: TButton;
Buttonmap41: TButton;
Buttonmap42: TButton;
Buttonmap43: TButton;
Buttonmap44: TButton;
Buttonmap45: TButton;
Buttonmap46: TButton;
Buttonmap47: TButton;
Buttonmap48: TButton;
Buttonmap49: TButton;
Buttonmap410: TButton;
Buttonmap51: TButton;
Buttonmap52: TButton;
Buttonmap53: TButton;
Buttonmap54: TButton;
Buttonmap55: TButton;
Buttonmap56: TButton;
Buttonmap57: TButton;
Buttonmap58: TButton;
Buttonmap59: TButton;
Buttonmap510: TButton;
Buttonmap61: TButton;
Buttonmap62: TButton;
Buttonmap63: TButton;
Buttonmap64: TButton;
Buttonmap65: TButton;
Buttonmap66: TButton;
Buttonmap67: TButton;
Buttonmap68: TButton;
Buttonmap69: TButton;
Buttonmap610: TButton;
Buttonmap71: TButton;
Buttonmap72: TButton;
Buttonmap73: TButton;
Buttonmap74: TButton;
Buttonmap75: TButton;
Buttonmap76: TButton;
Buttonmap77: TButton;
Buttonmap78: TButton;
Buttonmap79: TButton;
Buttonmap710: TButton;
Buttonmap81: TButton;
Buttonmap82: TButton;
Buttonmap83: TButton;
Buttonmap84: TButton;
Buttonmap85: TButton;
Buttonmap86: TButton;
Buttonmap87: TButton;
Buttonmap88: TButton;
Buttonmap89: TButton;
Buttonmap810: TButton;
Buttonmap91: TButton;
Buttonmap92: TButton;
Buttonmap93: TButton;
Buttonmap94: TButton;
Buttonmap95: TButton;
Buttonmap96: TButton;
Buttonmap97: TButton;
Buttonmap98: TButton;
Buttonmap99: TButton;
Buttonmap910: TButton;
Buttonmap101: TButton;
Buttonmap102: TButton;
Buttonmap103: TButton;
Buttonmap104: TButton;
Buttonmap105: TButton;
Buttonmap106: TButton;
Buttonmap107: TButton;
Buttonmap108: TButton;
Buttonmap109: TButton;
Buttonmap1010: TButton;
ListBox1: TListBox;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Layer: TLabel;
EditX: TEdit;
EditY: TEdit;
MapUp: TButton;
MapRight: TButton;
MapDown: TButton;
MapLeft: TButton;
ButtonReflesh: TButton;
addobject: TButton;
Declayer: TButton;
inclayer: TButton;
MainMenu1: TMainMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure ButtonRefleshClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Type TDlina= array of char;
TPloskost = array of Tdlina;
Tmap = array of TPloskost;
var
Form1: TForm1;
map:Tmap;
implementation
uses Unit2, Unit3, Unit4, Unit5;
{$R *.dfm}
procedure initmap(x,y,z:integer; map:Tmap);
var i,j,k:integer;
begin
map:=nil;
Setlength(map,x,y,z);
for I:= 1 to x-1 do
for j:= 1 to y-1 do
for k:= 1 to z-1 do
map[i, k, j]:='1';
end;
procedure Reflesh(map:Tmap;activelayer:integer);
var x,y : integer; xs,ys:string;
begin
x:=strtoint(Form1.EditX.Text);
y:=strtoint(Form1.EditY.Text);
Form1.buttonmap11.Caption :=map[x][y][activelayer];
Form1.buttonmap12.caption:= map[x][y+1][activelayer];
Form1.buttonmap13.caption:= map[x][y+2][activelayer];
Form1.buttonmap14.caption:= map[x,y+3,activelayer];
Form1.buttonmap15.caption:= map[x,y+4,activelayer];
Form1.buttonmap16.caption:= map[x,y+5,activelayer];
Form1.buttonmap16.caption:= map[x,y+6,activelayer];
Form1.Buttonmap18.caption:= map[x,y+7,activelayer];
Form1.Buttonmap19.caption:= map[x,y+8,activelayer];
Form1.Buttonmap110.caption:= map[x,y+9,activelayer];
Form1.Buttonmap21.caption:= map[x+1,y,activelayer];
Form1.Buttonmap22.caption:= map[x+1,y+1,activelayer];
Form1.buttonmap23.caption:= map[x+1,y+2,activelayer];
Form1.Buttonmap24.caption:= map[x+1,y+3,activelayer];
Form1.Buttonmap25.caption:= map[x+1,y+4,activelayer];
Form1.Buttonmap26.caption:= map[x+1,y+5,activelayer];
Form1.Buttonmap27.caption:= map[x+1,y+6,activelayer];
Form1.Buttonmap28.caption:= map[x+1,y+7,activelayer];
Form1.Buttonmap29.caption:= map[x+1,y+8,activelayer];
Form1.Buttonmap210.caption:= map[x+1,y+9,activelayer];
Form1.Buttonmap31.caption:= map[x+2,y,activelayer];
Form1.Buttonmap32.caption:= map[x+2,y+1,activelayer];
Form1.Buttonmap33.caption:= map[x+2,y+2,activelayer];
Form1.buttonmap34.caption:= map[x+2,y+3,activelayer];
Form1.Buttonmap35.caption:= map[x+2,y+4,activelayer];
Form1.Buttonmap36.caption:= map[x+2,y+5,activelayer];
Form1.Buttonmap37.caption:= map[x+2,y+6,activelayer];
Form1.Buttonmap38.caption:= map[x+2,y+7,activelayer];
Form1.Buttonmap39.caption:= map[x+2,y+8,activelayer];
Form1.Buttonmap310.caption:= map[x+2,y+9,activelayer];
Form1.Buttonmap41.caption:= map[x+3,y,activelayer];
Form1.Buttonmap42.caption:= map[x+3,y+1,activelayer];
Form1.Buttonmap43.caption:= map[x+3,y+2,activelayer];
Form1.Buttonmap44.caption:= map[x+3,y+3,activelayer];
Form1.Buttonmap45.caption:= map[x+3,y+4,activelayer];
Form1.Buttonmap46.caption:= map[x+3,y+5,activelayer];
Form1.Buttonmap47.caption:= map[x+3,y+6,activelayer];
Form1.Buttonmap48.caption:= map[x+3,y+7,activelayer];
Form1.Buttonmap49.caption:= map[x+3,y+8,activelayer];
Form1.Buttonmap410.caption:= map[x+3,y+9,activelayer];
Form1.buttonmap51.caption:= map[x+4,y+0,activelayer];
Form1.Buttonmap52.caption:= map[x+4,y+1,activelayer];
Form1.Buttonmap53.caption:= map[x+4,y+2,activelayer];
Form1.Buttonmap54.caption:= map[x+4,y+4-1,activelayer];
Form1.Buttonmap55.caption:= map[x+4,y+5-1,activelayer];
Form1.Buttonmap56.caption:= map[x+4,y+6-1,activelayer];
Form1.Buttonmap57.caption:= map[x+4,y+7-1,activelayer];
Form1.Buttonmap58.caption:= map[x+4,y+8-1,activelayer];
Form1.Buttonmap59.caption:= map[x+4,y+9-1,activelayer];
Form1.Buttonmap510.caption:= map[x+4,y+9,activelayer];
Form1.Buttonmap61.caption:= map[x+5,y+0,activelayer];
Form1.Buttonmap62.caption:= map[x+5,y+1,activelayer];
Form1.Buttonmap63.caption:= map[x+5,y+2,activelayer];
Form1.Buttonmap64.caption:= map[x+5,y+3,activelayer];
Form1.Buttonmap65.caption:= map[x+5,y+4,activelayer];
Form1.Buttonmap66.caption:= map[x+5,y+5,activelayer];
Form1.Buttonmap67.caption:= map[x+5,y+6,activelayer];
Form1.Buttonmap68.caption:= map[x+5,y+7,activelayer];
Form1.Buttonmap69.caption:= map[x+5,y+8,activelayer];
Form1.Buttonmap610.caption:= map[x+5,y+9,activelayer];
Form1.Buttonmap71.caption:= map[x+6,y+0,activelayer];
Form1.Buttonmap72.caption:= map[x+6,y+1,activelayer];
Form1.Buttonmap73.caption:= map[x+6,y+2,activelayer];
Form1.Buttonmap74.caption:= map[x+6,y+3,activelayer];
Form1.Buttonmap75.caption:= map[x+6,y+4,activelayer];
Form1.Buttonmap76.caption:= map[x+6,y+5,activelayer];
Form1.Buttonmap77.caption:= map[x+6,y+6,activelayer];
Form1.Buttonmap78.caption:= map[x+6,y+7,activelayer];
Form1.Buttonmap79.caption:= map[x+6,y+8,activelayer];
Form1.Buttonmap710.caption:= map[x+6,y+9,activelayer];
Form1.Buttonmap81.caption:= map[x+7,y+0,activelayer];
Form1.Buttonmap82.caption:= map[x+7,y+1,activelayer];
Form1.Buttonmap83.caption:= map[x+7,y+2,activelayer];
Form1.Buttonmap84.caption:= map[x+7,y+3,activelayer];
Form1.Buttonmap85.caption:= map[x+7,y+4,activelayer];
Form1.Buttonmap86.caption:= map[x+7,y+5,activelayer];
Form1.Buttonmap87.caption:= map[x+7,y+6,activelayer];
Form1.Buttonmap88.caption:= map[x+7,y+7,activelayer];
Form1.Buttonmap89.caption:= map[x+7,y+8,activelayer];
Form1.Buttonmap810.caption:= map[x+7,y+9,activelayer];
Form1.Buttonmap91.caption:= map[x+8,y+0,activelayer];
Form1.Buttonmap92.caption:= map[x+8,y+1,activelayer];
Form1.Buttonmap93.caption:= map[x+8,y+2,activelayer];
Form1.Buttonmap94.caption:= map[x+8,y+3,activelayer];
Form1.Buttonmap95.caption:= map[x+8,y+4,activelayer];
Form1.Buttonmap96.caption:= map[x+8,y+5,activelayer];
Form1.Buttonmap97.caption:= map[x+8,y+6,activelayer];
Form1.Buttonmap98.caption:= map[x+8,y+7,activelayer];
Form1.Buttonmap99.caption:= map[x+8,y+8,activelayer];
Form1.Buttonmap910.caption:= map[x+8,y+9,activelayer];
Form1.Buttonmap101.caption:= map[x+9,y+0,activelayer];
Form1.Buttonmap102.caption:= map[x+9,y+1,activelayer];
Form1.Buttonmap103.caption:= map[x+9,y+2,activelayer];
Form1.Buttonmap104.caption:= map[x+9,y+3,activelayer];
Form1.Buttonmap105.caption:= map[x+9,y+4,activelayer];
Form1.Buttonmap106.caption:= map[x+9,y+5,activelayer];
Form1.Buttonmap107.caption:= map[x+9,y+6,activelayer];
Form1.Buttonmap108.caption:= map[x+9,y+7,activelayer];
Form1.Buttonmap109.caption:= map[x+9,y+8,activelayer];
Form1.Buttonmap1010.caption:= map[x+9,y+9,activelayer];
end;
procedure TForm1.N4Click(Sender: TObject);
begin
Form2.showmodal;
end;
procedure TForm1.N5Click(Sender: TObject);
begin
Form3.showmodal;
end;
procedure TForm1.N6Click(Sender: TObject);
begin
form4.showmodal;
end;
procedure TForm1.N7Click(Sender: TObject);
begin
Halt;
end;
procedure TForm1.N9Click(Sender: TObject);
begin
form5.showmodal;
end;
procedure TForm1.ButtonRefleshClick(Sender: TObject);
begin
reflesh(map,1);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
initmap(13,13,3,map);
end;
end.
проект тот же но опять не работает