koło Fortuny w Delphi! Pomocy

0

Umie ktoś zrobić taki program?? Chodzi o to żeby w jednym Edit pojawiało sie ukryte hasło pod gwaizdkami a do drugiego trzeba wpisać literke jaką chcemy i po naciśnięciu buttona albo się odsłaniała ta literka (jeśli jest w haśle) a jeśli nie to podajemy następną :) Prosze o pomocccc!!! :):)

0

nic prostszego. Po prostu w petli sprawdzasz pokolei czy w tym wyrazie co masz odgadnąc jest dana litera. Potem odczytujesz pozycje tych liter funkcją

pos()

i "odkrywasz" odppowiednie litery.

0

Moim zdaniem użycie editów do tych celów nie będzie elegancko wyglądało. Użytkownik po jednym zagraniu znudzi się, skoro w necie dostępne są kolorowe plansze itp. Chyba, że program ten z użyciem tych komponentów Tobie odpowiada. Czasami będziesz chciał rozbudować swoje Koło fortuny i będziesz musiał zacząć zmieniać swoją aplikację, także usuwając edit. Poczekaj może ktoś na forum podpowie Tobie więcej.
http://www.januszg.hg.pl/programy/kolo_fortuny.html

0

Jeśli chcesz z edit to rozbuduj ten kod:

if Pos(Edit1.Text,Edit2.Text) <> 0 then
Label1.Caption := 'Dobra literka' else Label1.Caption := 'Zla litera';

W w edit1 musi być taka sama litera lub wyraz co w edit2 -> Dobra literka

Pozdrawiam ;)

0

Oto kod napisany naprędce.

unit Kolo1;

(...)

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.CharCase := ecUpperCase;
{itd aż do Edit20}
end;

procedure TForm1.SprawdzClick(Sender: TObject);
begin
 if Pos(Edit1.Text,Edit11.Text) <> 0 then
Label1.Caption := ':-)' else Label1.Caption := ':-(';
 if Pos(Edit2.Text,Edit12.Text) <> 0 then
Label2.Caption := ':-)' else Label2.Caption := ':-(';
 if Pos(Edit3.Text,Edit13.Text) <> 0 then
Label3.Caption := ':-)' else Label3.Caption := ':-(';
 if Pos(Edit4.Text,Edit14.Text) <> 0 then
Label4.Caption := ':-)' else Label4.Caption := ':-(';
 if Pos(Edit5.Text,Edit15.Text) <> 0 then
Label5.Caption := ':-)' else Label5.Caption := ':-(';
 if Pos(Edit6.Text,Edit16.Text) <> 0 then
Label6.Caption := ':-)' else Label6.Caption := ':-(';
 if Pos(Edit7.Text,Edit17.Text) <> 0 then
Label7.Caption := ':-)' else Label7.Caption := ':-(';
 if Pos(Edit8.Text,Edit18.Text) <> 0 then
Label8.Caption := ':-)' else Label8.Caption := ':-(';
 if Pos(Edit9.Text,Edit19.Text) <> 0 then
Label9.Caption := ':-)' else Label9.Caption := ':-(';
 if Pos(Edit10.Text,Edit20.Text) <> 0 then
Label10.Caption := ':-)' else Label10.Caption := ':-(';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.PasswordChar := '*';
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit2.PasswordChar := '*';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Edit3.PasswordChar := '*';
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Edit4.PasswordChar := '*';
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
Edit5.PasswordChar := '*';
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
Edit6.PasswordChar := '*';
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
Edit7.PasswordChar := '*';
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
Edit8.PasswordChar := '*';
end;

procedure TForm1.Button9Click(Sender: TObject);
begin
Edit9.PasswordChar := '*';
end;

procedure TForm1.Button10Click(Sender: TObject);
begin
Edit10.PasswordChar := '*';
end;

procedure TForm1.Ustawienia_domyslneClick(Sender: TObject);
begin
{Programiści wybaczcie, że nie użyłem skrótu}
Edit1.PasswordChar := #0;
Edit2.PasswordChar := #0;
Edit3.PasswordChar := #0;
Edit4.PasswordChar := #0;
Edit5.PasswordChar := #0;
Edit6.PasswordChar := #0;
Edit7.PasswordChar := #0;
Edit8.PasswordChar := #0;
Edit9.PasswordChar := #0;
Edit10.PasswordChar :=#0;
end;

Pod Editem 11,12,13 itd umieść label1, label2 , label3 itd.

0

Dzięki Ci baaaardzo za ten kod :) Ale ja jestem komplenym laikiem i nie wiem gdzie niektóre rzeczy wpisać :( Może mi ktoś skleić ten program ??:) Prosze prosze :) Mój numer gg 1524058- potrzebne mi to na poniedziałek !

1 użytkowników online, w tym zalogowanych: 0, gości: 1