my %num2call = do '070-members-20120317.inc'; my %BONUSWORDS = ( used_calls => {}, words => [ { label => 'ERIN', letters => { map { $_ => 0 } split '', 'ERIN' }, points => 100, }, { label => 'GO', letters => { map { $_ => 0 } split '', 'GO' }, points => 100, }, { label => 'BRAGH', letters => { map { $_ => 0 } split '', 'BRAGH' }, points => 100, }, ], sweep_points => 200, ); { version => '03', contest_name => "St. Patrick's Day Contest", contest_id => '070-ST-PATS', filter => { mode => \"IN ('PSK31', 'BPSK', 'BPSK31', 'QPSK31', 'PSK')", band => \"IN('160M','80M','40M','20M','15M','10M','6M')", }, defaults => { contest_url => 'http://www.podxs070.com/st-patricks-day-contest-rules', contest_logo => 'http://www.podxs070.com/images/stories/PotOfGold.jpg', log_cols => [qw/ call qso_date time_on band spc srx sfx dxccprefix state calc1 calc2 /], placeholders => [qw/ ADDRESS Email 070-Number SOAPBOX /], scoreboard_cols => [qw/ 070-number /], update => sub { my $row = shift; my %h; my $letter = substr $row->{sfx}, 0, 1; $h{calc1} = $letter; $h{call} = $row->{call}; $h{call} =~ s#^[A-Z]+\d*/##; # strip portable from front, e.g. W3/ $h{call} =~ s#/\d+$##; # strip portable from back, e.g. /7 if( $row->{srx} =~ /\D/ ){ my $srx = $row->{srx}; $srx =~ s/\b070\b//g; # so '070' club name doesn't false-positive as the 070#. $h{srx} = $1 if $srx =~ /(\d+)/; } # $h{srx} = $1 if $row->{srx} =~ /\D/ && $row->{srx} =~ /(\d+)/; $h{srx} = sprintf '%04d', $h{srx} || $row->{srx} || 0; if( $h{srx} !~ /[1-9]/ ){ $h{contest_use} = "No 070#"; }elsif( $h{call} ne $num2call{ $h{srx} } ){ $h{contest_use} = "Call/070# do not match" } $h{state} = '' unless $row->{state}; $h{state} = 'MD' if $row->{state} =~ /^(MDC|DC)$/i; foreach my $word ( @{ $BONUSWORDS{words} } ){ last if exists $BONUSWORDS{used_calls}->{ $h{call} }; next unless exists $word->{letters}->{$letter}; next if $word->{letters}->{$letter}; $word->{letters}->{$letter}++; $BONUSWORDS{used_calls}->{ $h{call} }++; $h{calc2} = $word->{label}; last; } return \%h; }, Qs => [ { label => "ERRORS", weight => 0, group_by => 'call,qso_date,time_on,band,srx, contest_use', where => { contest_use => {'!='=>1} } }, { group_by => 'call, srx, band', where => { # srx =>{'!=','0000'}, contest_use => 1, }, }, { label => "ERRORS - unknown DXCC; no mult credit", weight => 0, group_by => 'qso_date,time_on,band,call', where => {dxccprefix=>'??'} }, { label => "ERRORS - unknown state/province; no mult credit", weight => 0, group_by => 'qso_date,time_on,band,call,dxccprefix', where => {dxccprefix=>[qw/K KH6 KL7 VE/],state=>''} }, # { label => "Non-club members", weight => 0, group_by => 'call, band', where => { srx =>'0000' } }, ], mults => [ { label => 'DXCC', group_by => 'dxccprefix', where => { contest_use=>1, dxccprefix=>{'!='=>'??'} } }, { label => 'States', group_by => 'state', where => { contest_use=>1, dxccprefix => [qw/K KH6 KL7/], state=>{'!='=>''} } }, { label => 'Provinces', group_by => 'state', where => { contest_use=>1, dxccprefix => 'VE', state=>{'!='=>''} } }, ], bonus => [ { label => 'EI3GRB', weight => 200, group_by => 'call', where => { call=>'EI3GRB' } }, # (map { # my @letters = split '', $_; # { ct => scalar(@letters), label => $_, weight => 100/scalar(@letters), group_by => 'calc1', where => { calc1 => \@letters } }, # } qw/ ERIN GO BRAGH /), # { label => 'Erin-Go-Bragh: NOT SUPPORTED by scorer.
Add the extra 200pts if you got all three
.', weight => 0, group_by => 'call', where => { call=>undef } }, (map { my $label = $_->{label}; my $points = $_->{points}; my $n = length($label); { ct => $n, label => $label, weight => 100/$n, group_by => 'call,band', where => { calc2 => $label } }, } @{ $BONUSWORDS{words} } ), do { my @words = map { $_->{label} } @{ $BONUSWORDS{words} }; my $n = 0; $n += length $_ for @words; { ct => $n, label => 'ERIN-GO-BRAGH', weight => $BONUSWORDS{sweep_points}/$n, group_by => 'call,band,calc2', where => { calc2 => \@words } }, }, ], }, years => { 2011 => { closed => 1, sample => '', filter => { qso_date => '20110317', }, }, 2012 => { sample => '', filter => { qso_date => '20120317', }, }, }, }