Moin an alle.
Programmiere grade ein Mathe Lernprogramm. Wenn nun in einem Level die Aufgaben generiert werden, hätte ich gerne das ich durch drücken eines "Zur nächsten Aufgabe" Button direkt in einem Editfeld stehe, wo ich die Lösung eingeben kann. Hier mal der Quellcode für die Erstellung der Aufgabe:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| procedure TForm1.Button2Click(Sender: TObject); begin
a[i]:= strtoint(Label1.caption) + strtoint(Label2.Caption); l[i]:= strtoint(Edit1.text); if l[i] = a[i] then Edit2.text := inttostr(strtoint(Edit2.text) + 1) else Edit3.text := inttostr(strtoint(Edit3.text) + 1); Edit1.text := ' '; i:=i+1; randomize ;
begin Label1.caption := inttostr(random(10)); Label2.caption := inttostr(random(10)); if strtoint(Label1.caption) + strtoint(Label2.Caption) > 10 then begin repeat Label2.caption := inttostr(random(10)); until strtoint(Label1.caption) + strtoint(Label2.Caption) <=10; end; Edit1.Enabled := true;<span style="font-size: 18px; line-height: normal"> end; |
Weiß nicht ob ich es verständlich rüberbringen konnte was ich meine... bei unklarheiten einfach nachfragen.
Ich bedanke mich schonmal für eure Ideen und Antworten...
mfg Markus
1100101 heißt ich Liebe dich ich möchte bei dir sein! (search Song:"Das Modul - 1100101")