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.
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; s := 0; inc (v); For i:=1 To x Do begin a := random(6)+1; LBZahlen.Items.Add (IntToStr(a)); if (a = 6) then begin inc (s); sz := sz + 1; end; end; i:=0; inc(i); sd[i] := (100-s); 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; fGraph.imgPlot.Canvas.MoveTo(0,0); for i:= v downto 1 do fGraph.imgPlot.Canvas.MoveTo(i*8,(sd[i])*8); fGraph.imgPlot.Canvas.LineTo(i*8,(sd[i])*8); end; |
Moderiert von
raziel: Delphi-Tags hinzugefügt