Add the YOTA and OK/OM DX contests

Both are in the station's log and neither could be opened. The rules are
written from the published ones and checked by replaying the log.

YOTA scores a contact by the age the other operator sends: 13 points down to 10
for anyone 25 or under, whatever the continent, and 1 point or 3 for everyone
else. Every age worked on a band is a multiplier. The 2024, 2025 and 2026 logs
come out to the contact.

OK/OM DX is the first contest whose exchange differs by the other station's
country: a county from OK and OM stations, a serial number from everyone else,
in the two columns N1MM keeps them in, and `SkipsField` walks the entry window
past the box that does not apply. Points depend on which side the operator is
on, and Czechia and Slovakia count as the two countries they are. The 2023 log
comes out to the contact.

The Cabrillo exchange now gets the entry, because YOTA sends an age that only
the contest setup knows.

Two differences are left in the log, both from the .udc files the operator
used: their YOTA file only lists ages 7 to 25, so a younger operator scored as
an adult, and one OK/OM log was made with the file for stations outside OK and
OM while signing an OM call.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
2026-08-31 09:16:44 +00:00
co-authored by Claude Opus 5
parent 5c0ca558c1
commit 3932f83147
22 changed files with 360 additions and 23 deletions
+70
View File
@@ -0,0 +1,70 @@
using Nonemm.Core;
namespace Nonemm.Contests.Rules;
/// The YOTA contest. The exchange is the operator's age, a contact with a
/// young operator is worth more, and every age worked on a band is a
/// multiplier.
///
/// N1MM has no class for this one — it is logged there through a `.udc` file,
/// which is why the contest name is plain `YOTA`.
public sealed class Yota : Contest
{
public string Name => "YOTA";
public string DisplayName => "YOTA Contest";
public string CabrilloName => "YOTA";
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
[
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
new ExchangeField("Age", ExchangeSlot.Exchange1, ExchangeFieldKind.Number) { Width = 3 },
];
public IReadOnlyList<string> MultiplierNames => ["Ages"];
public DupeScope DupeScope => DupeScope.PerBandAndMode;
public bool HasSerialNumbers => false;
public IReadOnlyList<ModeCategory> Modes => [ModeCategory.Cw, ModeCategory.Phone];
/// The operator's own age, which the contest setup asks for.
public string SentExchangeFor(StationInfo me) => "";
/// A contact with an operator of 25 or under is worth 10 to 13 points by
/// age, whatever the continent. Everyone else is worth 1 point on your own
/// continent and 3 from another.
public int PointsFor(QsoContext qso) => Age(qso) switch
{
null or > 25 => qso.IsSameContinent ? 1 : 3,
<= 12 => 13,
<= 16 => 12,
<= 21 => 11,
_ => 10,
};
/// Each age worked on a band, whatever the mode.
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso) =>
Age(qso) is { } age ? [new Multiplier(1, age.ToString(), qso.Band?.Name ?? "")] : [];
public int TotalScore(ScoreTally tally, ContestEntry entry) =>
tally.Points * tally.TotalMultipliers;
public CabrilloExchange CabrilloExchange(Qso qso, StationInfo me, ContestEntry entry) =>
new(
[
new CabrilloField(me.Callsign, 13),
new CabrilloField(qso.SentReport, 3),
new CabrilloField(entry.SentExchange, 3),
],
[
new CabrilloField(qso.Call.Text, 13),
new CabrilloField(qso.ReceivedReport, 3),
new CabrilloField(qso.Exchange1, 3),
]);
private static int? Age(QsoContext qso) =>
int.TryParse(qso.Qso.Exchange1.Trim(), out int age) && age > 0 ? age : null;
}