unit UHaupt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus, URaetsel;
type
TForm1 =
class(TForm)
LRatewort: TLabel;
MainMenu1: TMainMenu;
ERatewort: TEdit;
LBuchstabe: TLabel;
EBuchstabe: TEdit;
BSetzen: TButton;
ELoesungswort: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure BSetzenClick(Sender: TObject);
procedure ERatewortExit(Sender: TObject);
procedure ERatewortEnter(Sender: TObject);
procedure EBuchstabeEnter(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Raetsel: TRaetsel;
swort:
string;
i:integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Raetsel:= TRaetsel.Create;
i:=0;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Raetsel.free;
end;
procedure TForm1.BSetzenClick(Sender: TObject);
begin
Raetsel.BuchstabeSenden(EBuchstabe.Text);
end;
procedure TForm1.ERatewortExit(Sender: TObject);
var leange,i:integer;
begin
swort:=eRatewort.text;
raetsel.Init(swort);
Ebuchstabe.setfocus;
if Raetsel.pruefen=true
then begin
showmessage('
falsch');
ERatewort.setfocus;
Eratewort.clear;
end
else eloesungswort.text:=Raetsel.Zielwort;
end;
procedure TForm1.ERatewortEnter(Sender: TObject);
begin
ERatewort.Text:='
';
eLoesungswort.text:='
';
EBuchstabe.text:='
';
end;
procedure TForm1.EBuchstabeEnter(Sender: TObject);
begin
ebuchstabe.Clear;
end;
end.