diff --git a/ArrlSS.pas b/ArrlSS.pas index 3fca106..5e1f898 100644 --- a/ArrlSS.pas +++ b/ArrlSS.pas @@ -62,7 +62,7 @@ TSweepstakes = class(TContest) procedure SaveEnteredExchToQso(var Qso: TQso; const AExch1, AExch2: string); override; function GetStationInfo(const ACallsign: string) : string; override; function ExtractMultiplier(Qso: PQso) : string; override; - function GetCheckSection(const ACallsign: string; AThreshold: extended = 0): String; + function GetCheckSection(const ACallsign: string; AThreshold: Single = 0): String; function IsNum(Num: String): Boolean; end; @@ -412,10 +412,23 @@ function TSweepstakes.getCall(id:integer): string; // returns station callsi } procedure TSweepstakes.GetExchange(id : integer; out station : TDxStation); const - PrecedenceTbl: array[0..5] of string = ('Q', 'A', 'B', 'U', 'M', 'S'); + PrecedenceTbl: array[0..5] of string = ('A', 'B', 'U', 'Q', 'M', 'S'); begin station.NR := GetRandomSerialNR; // serial number - station.Prec := PrecedenceTbl[Random(6)]; + + // Mark, KD0EE, recommends 50% calls are A, 20% B, 20% U, 10% for the rest. + // Jim, K6OK, reported 37% calls are A, 19% B, 36% U, 10% for the rest. + // Using the average ... 43% A, 19% B, 28% U, 10% for Q, M and S. + var R: Single := Random; + if R < 0.43 then + station.Prec := PrecedenceTbl[0] + else if R < 0.62 then + station.Prec := PrecedenceTbl[1] + else if R < 0.90 then + station.Prec := PrecedenceTbl[2] + else + station.Prec := PrecedenceTbl[3+Random(3)]; + station.Chk := SweepstakesCallList.Items[id].Check; station.Sect := SweepstakesCallList.Items[id].Section; station.UserText := SweepstakesCallList.Items[id].UserText; @@ -464,7 +477,7 @@ function TSweepstakes.ExtractMultiplier(Qso: PQso) : string; so the user has to correct the string being copied. } function TSweepstakes.GetCheckSection(const ACallsign: string; - AThreshold: extended): String; + AThreshold: Single): String; var ssrec: TSweepstakesCallRec; section: string; diff --git a/Main.pas b/Main.pas index b947b3e..0edf1bb 100644 --- a/Main.pas +++ b/Main.pas @@ -2261,7 +2261,8 @@ procedure TMainForm.Advance; (ActiveControl = Edit3) and (Edit3.Text = '') and (Random < (ShowCheckSection/100)) then begin - var S: string := (Tst as TSweepstakes).GetCheckSection(Edit1.Text, 0.25); + // inject a Section error 10% of the time + var S: string := (Tst as TSweepstakes).GetCheckSection(Edit1.Text, 0.10); if not S.IsEmpty then S := S + ' '; Edit3.Text := S; diff --git a/Util/Lexer.pas b/Util/Lexer.pas index aca593f..43f7be0 100644 --- a/Util/Lexer.pas +++ b/Util/Lexer.pas @@ -145,7 +145,6 @@ constructor TLexer.Create(const ARules: array of TTokenRuleDef; Rule.regex := Reg; Rule.tokenType := Def.T; Rules.Add(Rule); - Reg := nil; end; end;