Autor Beitrag
Bockscar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 105



BeitragVerfasst: Fr 17.03.06 20:34 
Bei dem Code

ausblenden Delphi-Quelltext
1:
2:
 case winmatrix[number][lauf] of
 0..36   : win := win + 35*player1_bets[winmatrix[number][lauf]];


möchte ich gerne checken ob win sich verändert oder nicht.

D.h.: Ist "win" vor der Zeile bei Wert 0 und danach bei 10 möchte ich das irgendwie prüfen können und falls es sich geändert hat (es kann nur größer werden da 35*player1_bets[winmatrix[number][lauf] nur positiv sein kann) möchte ich eben etwas ausführen

es ginge ja z.b so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 case winmatrix[number][lauf] of
 0..36   : begin
           temp := win;
           win := win + 35*player1_bets[winmatrix[number][lauf]];
           if not temp = win then { ... }
           end;


Gibts da irgendwas anderes, was vlt. eleganter ist ... kann ja auch sein, dass es wegen meiner schreibweise gar nicht anders machbar ist ...

waere jedenfalls erfreut mglweise etwas neues zu lernen :)
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Fr 17.03.06 20:46 
reicht es nicht, wenn du prüft, ob 35*player1_bets[winmatrix[number][lauf]] 0 ergibt? oder noch einfacher: überprüfe, ob player1_bets[winmatrix[number][lauf]] = 0 ist.
Denn win wird ja nicht größer wenn man 0 addiert :roll:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
 case winmatrix[number][lauf] of
 0..36   : begin
            if player1_bets[winmatrix[number][lauf]] > 0 then ..
           end;


hoffe ich liege richtig :roll:
Bockscar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 105



BeitragVerfasst: Fr 17.03.06 21:09 
alles klaro. sieht so besser aus