mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
AceyDucey/pascal: Move Randomize()
Randomize() should be called only once and as soon as possible.
This commit is contained in:
@@ -85,6 +85,7 @@ end;
|
|||||||
|
|
||||||
constructor TGame.Create;
|
constructor TGame.Create;
|
||||||
begin
|
begin
|
||||||
|
Randomize;
|
||||||
FDeck:= TDeck.Create;
|
FDeck:= TDeck.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -99,7 +100,6 @@ begin
|
|||||||
ClrScr;
|
ClrScr;
|
||||||
PrintGreeting;
|
PrintGreeting;
|
||||||
repeat
|
repeat
|
||||||
Randomize;
|
|
||||||
FStash:= 100;
|
FStash:= 100;
|
||||||
repeat
|
repeat
|
||||||
PrintBalance;
|
PrintBalance;
|
||||||
|
|||||||
@@ -118,10 +118,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Randomize;
|
||||||
ClrScr;
|
ClrScr;
|
||||||
PrintGreeting;
|
PrintGreeting;
|
||||||
repeat
|
repeat
|
||||||
Randomize;
|
|
||||||
Stash:= 100;
|
Stash:= 100;
|
||||||
repeat
|
repeat
|
||||||
PrintBalance;
|
PrintBalance;
|
||||||
|
|||||||
Reference in New Issue
Block a user