Pay Oceania's high bands what they are worth
The band table stopped after 40 metres and gave every other band one point. It should be 20 on 160, 10 on 80, 5 on 40, 1 on 20, 2 on 15 and 3 on 10: from Oceania the high bands are the hard ones, so they pay more than 20 metres does. The WIA scoring table and N1MM's COceania.ComputePoints agree on all six. The catch-all hid a second fault. N1MM's table ends without one, so a band that is not in the contest — the WARC bands, 6 metres — scores nothing; here it scored a point. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ
This commit is contained in:
@@ -64,13 +64,21 @@ public sealed class OceaniaDx : Contest
|
|||||||
public bool IsWorkable(QsoContext qso) =>
|
public bool IsWorkable(QsoContext qso) =>
|
||||||
qso.Continent == "OC" || qso.Me.Continent == "OC";
|
qso.Continent == "OC" || qso.Me.Continent == "OC";
|
||||||
|
|
||||||
|
/// What a contact is worth on each of the contest's six bands. The high
|
||||||
|
/// bands pay more than 20 metres, which is the other way round from most
|
||||||
|
/// contests: from Oceania they are the hard ones. A band that is not in
|
||||||
|
/// this table is not in the contest — the WARC bands and 6 metres — and
|
||||||
|
/// scores nothing, which is how N1MM's `COceania.ComputePoints` ends as
|
||||||
|
/// well.
|
||||||
private static int PointsOn(Band? band) => band?.Name switch
|
private static int PointsOn(Band? band) => band?.Name switch
|
||||||
{
|
{
|
||||||
"160M" => 20,
|
"160M" => 20,
|
||||||
"80M" => 10,
|
"80M" => 10,
|
||||||
"40M" => 5,
|
"40M" => 5,
|
||||||
null => 0,
|
"20M" => 1,
|
||||||
_ => 1,
|
"15M" => 2,
|
||||||
|
"10M" => 3,
|
||||||
|
_ => 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
private string ModeLabel() => mode == ModeCategory.Cw ? "CW" : "SSB";
|
private string ModeLabel() => mode == ModeCategory.Cw ? "CW" : "SSB";
|
||||||
|
|||||||
@@ -13,11 +13,25 @@ public class OceaniaDxTests
|
|||||||
[InlineData(3_650, 10)]
|
[InlineData(3_650, 10)]
|
||||||
[InlineData(7_050, 5)]
|
[InlineData(7_050, 5)]
|
||||||
[InlineData(14_150, 1)]
|
[InlineData(14_150, 1)]
|
||||||
public void TheLowerTheBandTheMorePoints(double kilohertz, int expected) =>
|
[InlineData(21_150, 2)]
|
||||||
|
[InlineData(28_150, 3)]
|
||||||
|
public void EachBandOfTheContestHasItsOwnPoints(double kilohertz, int expected) =>
|
||||||
Assert.Equal(
|
Assert.Equal(
|
||||||
expected,
|
expected,
|
||||||
LogFor().Judge(TestLog.Contact("VK4XYZ", kilohertz, mode: Modes.Usb)).Points);
|
LogFor().Judge(TestLog.Contact("VK4XYZ", kilohertz, mode: Modes.Usb)).Points);
|
||||||
|
|
||||||
|
/// The contest is on six bands. A contact on any other — the WARC bands,
|
||||||
|
/// 6 metres — is worth nothing, which is where N1MM's table ends too.
|
||||||
|
[Theory]
|
||||||
|
[InlineData(10_120)]
|
||||||
|
[InlineData(18_100)]
|
||||||
|
[InlineData(24_930)]
|
||||||
|
[InlineData(50_150)]
|
||||||
|
public void ABandOutsideTheContestScoresNothing(double kilohertz) =>
|
||||||
|
Assert.Equal(
|
||||||
|
0,
|
||||||
|
LogFor().Judge(TestLog.Contact("VK4XYZ", kilohertz, mode: Modes.Usb)).Points);
|
||||||
|
|
||||||
/// One side of the contact has to be in Oceania.
|
/// One side of the contact has to be in Oceania.
|
||||||
[Fact]
|
[Fact]
|
||||||
public void AContactOutsideOceaniaScoresNothing()
|
public void AContactOutsideOceaniaScoresNothing()
|
||||||
|
|||||||
Reference in New Issue
Block a user