Autor Beitrag
Mammuth
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Fr 05.01.07 01:54 
Hi! Hab jetzt letzendlich den Quelltext hingekriegt... Hab auch das programm fertig...verstehe aber nicht wie so zeigt er mir den Graph nicht. Hier ist mein quelletxt.
Einloggen, um Attachments anzusehen!
Mammuth Threadstarter
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Fr 05.01.07 02:07 
den quelltext noch dazu...
Es handelt sich um ein experiment, wo amn 100 würfel wurfelt, wenn eine 6 kommt, dann wird sie weggenommen und dann bleiben ja weniger Würfel. So wird gewurfelt bis keine Würfel mehr bleiben. So war das.


ausblenden volle Höhe 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:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
 procedure TWuerfel.BStartClick(Sender: TObject);
begin
  randomize;
  LBZahlen.Clear;
  ESechsen.Clear;
  EGesamtsechsen.Clear;
   x := 100 - sz; {die letztes mal ausgefallene Würfel abziehen}
   s := 0;
   inc (v);  {anzahl der versuche}
    For i:=1 To x Do
     begin
      a := random(6)+1;  {wurfeln}
      LBZahlen.Items.Add (IntToStr(a));
       if (a = 6) then
        begin
         inc (s); {sechsen Anzahl}
         sz := sz + 1;  {Gesammtsumme Sechsen}
        end;
     end;
     i:=0;   {meine anbau für die graphische darstellung, wollte array benutzen um die daten zu speichern}
     inc(i);
    sd[i] := (100-s); {sd[i] ist mein Array}
    ESechsen.Text := IntToStr(s);
    EGesamtsechsen.Text := IntToStr(sz);
    LBDurchgaenge.Items.Add (IntToStr(v));
    LBGesamtzahlen.Items.Add(IntToStr(x));
           if (x = 0) then
            begin
             BStart.Visible := False;
             BAuswerten.Visible := True;
            end;
end;


procedure TWuerfel.BAuswertenClick(Sender: TObject);
   begin
      Fgraph.Show;
      drawFunktion();

    fGraph.imgPlot.canvas.Pen.Color := clBlack; // Farbe des Stifts setzen

     fGraph.imgPlot.Canvas.MoveTo(0,0);
    for i:= v downto 1 do
     fGraph.imgPlot.Canvas.MoveTo(i*8,(sd[i])*8);  {mein Graph, wird nicht angezeigt...}
     fGraph.imgPlot.Canvas.LineTo(i*8,(sd[i])*8);
end;


Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Dragonclaw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 196

Windows Vista
Delphi 7 Prof.
BeitragVerfasst: Fr 05.01.07 02:47 
Hallo,

guck dir das hier mal an: www.chris-tec.net/DE...nsplotter/index.html

Dort wird erklärt wie du nen funktionsplotter schreibst. kannste dir ja mal an gucken :). Sonst hilft auch Google weiter.