The delphi random function isn't very good, if possible you could get more realistic results by using the RandG function (need to include the "Math" library). This function gives you a result with a gaussian probability.

function RandG(Mean, StdDev: Extended): Extended;

if you use the mean as 0 then the results will be 66% likely to be 1 standard deviation away from 0 (could be + or - through)

The teams power could then be related to the StdDev that you use

ie higher team power = smaller StdDev = more chance of result being nearer 0.

0 could then be a goal.

The result for this function is an EXTENDED that is 3.45643 for example. You will need to round or trunc these results to then get an integer result but then it sould work well!

Below is an example of this function.

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Math, StdCtrls;

type

TForm1 = class(TForm)

Button1: TButton;

Edit1: TEdit;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin

Edit1.Text := FloatToStr(RandG(0,10));

end;

end.

The edit box will show the result of the function call and it will be between -10 and +10 about 66% of the time.

Hope this helps.

Steve A

function RandG(Mean, StdDev: Extended): Extended;

if you use the mean as 0 then the results will be 66% likely to be 1 standard deviation away from 0 (could be + or - through)

The teams power could then be related to the StdDev that you use

ie higher team power = smaller StdDev = more chance of result being nearer 0.

0 could then be a goal.

The result for this function is an EXTENDED that is 3.45643 for example. You will need to round or trunc these results to then get an integer result but then it sould work well!

Below is an example of this function.

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Math, StdCtrls;

type

TForm1 = class(TForm)

Button1: TButton;

Edit1: TEdit;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender

begin

Edit1.Text := FloatToStr(RandG(0,10));

end;

end.

The edit box will show the result of the function call and it will be between -10 and +10 about 66% of the time.

Hope this helps.

Steve A