mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -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;
|
||||
begin
|
||||
Randomize;
|
||||
FDeck:= TDeck.Create;
|
||||
end;
|
||||
|
||||
@@ -99,7 +100,6 @@ begin
|
||||
ClrScr;
|
||||
PrintGreeting;
|
||||
repeat
|
||||
Randomize;
|
||||
FStash:= 100;
|
||||
repeat
|
||||
PrintBalance;
|
||||
|
||||
@@ -118,10 +118,10 @@ begin
|
||||
end;
|
||||
|
||||
begin
|
||||
Randomize;
|
||||
ClrScr;
|
||||
PrintGreeting;
|
||||
repeat
|
||||
Randomize;
|
||||
Stash:= 100;
|
||||
repeat
|
||||
PrintBalance;
|
||||
|
||||
Reference in New Issue
Block a user