Einzelnen Beitrag anzeigen

Benutzerbild von Nikolas
Nikolas

Registriert seit: 28. Jul 2003
1.528 Beiträge
 
Delphi 2005 Personal
 
#23

Re: Game "Deal or No Deal"

  Alt 16. Jul 2006, 11:25
hm hatte ich übersehen.

Hier mal die Übersetzung von Balus Seite:

Delphi-Quellcode:
function Tform1.NewCalcBank: Longword;
var
l,h: real;
i: integer;
lowsum, highsum: real;
lowtotal, hightotal: real;
count: byte;
limes: integer;
begin
lowtotal:=0;
hightotal:=0;
limes:= 75000;

for i:=1 to 26 do
    if MoneyButton[i].Enabled then
      if Money[i]<= limes then
         lowsum:=lowsum+money[i]
      else
         highsum:=highsum+money[i];

case Bagcount of
    20: begin l:=0.07; h:= 0.11 ; end;
    15: begin l:=0.09; h:= 0.16 ; end;
    11: begin l:=0.13; h:= 0.21 ; end;
     8: begin l:=0.17; h:= 0.26 ; end;
     6: begin l:=0.20; h:= 0.31 ; end;
     5: begin l:=0.33; h:= 0.32 ; end;
     1..4: begin l:=0.5; h:= 0.32+(5-bagcount)*0.01; end;
end;

lowtotal:= lowsum*l;
hightotal:= highsum*l*h;

result:= round(lowtotal+hightotal);

end;
Die Grenze zwischen low und high müsste noch angepasst werden, da der Maximalpreis vom Land abhängt.
Erwarte das Beste und bereite dich auf das Schlimmste vor.
  Mit Zitat antworten Zitat