unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, HangManClasses, StdCtrls;
type
TFormMain =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
FormMain: TFormMain;
HangManWord: THangManWord;
implementation
{$R *.dfm}
procedure TFormMain.FormCreate(Sender: TObject);
var i:integer; output:
string;
begin
HangManWord:=THangManWord.Create;
HangManWord.NewWord('
heiko');
SetLength(output,hangmanword.WordLength);
for i:=0
to HangManWord.WordLength
do
begin
output[i]:=HangManWord.CharWord[i];
end;
edit1.Text:=output;
end;
procedure TFormMain.FormDestroy(Sender: TObject);
begin
HangManWord.Free;
end;
procedure TFormMain.Button1Click(Sender: TObject);
var a:char; output:
string; i:integer;
begin
a:=edit2.text[1];
Hangmanword.TestLetter(a);
for i:=0
to HangManWord.WordLength
do
begin
output[i]:=HangManWord.CharWord[i];
end;
edit1.Text:=output;
end;
end.