| 1 | #!/usr/bin/perl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # Copyright (C) 2009-2021 Alex Schroeder <alex@gnu.org> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # Copyright (C) 2020 Christian Carey | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # This program is free software: you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # the terms of the GNU General Public License as published by the Free Software | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # Foundation, either version 3 of the License, or (at your option) any later | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | # This program is distributed in the hope that it will be useful, but WITHOUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # You should have received a copy of the GNU General Public License along with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | # this program. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | package Traveller::System::Classic::MPTS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use Mojo::Base 'Traveller::System::Classic'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub compute_tradecodes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
compute_tradecodes: not called CC=37 SCAR=72.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $tradecodes = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | $tradecodes .= ' Ag' if $self->atmosphere >= 4 and $self->atmosphere <= 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/15
$self->atmosphere >= 4 and $self->atmosphere <= 9 and $self->hydro >= 4 and $self->hydro <= 8 and $self->population >= 5 and $self->population <= 7
$self->atmosphere >= 4 and $self->atmosphere <= 9 and $self->hydro >= 4 and $self->hydro <= 8 and $self->population >= 5
$self->atmosphere >= 4 and $self->atmosphere <= 9 and $self->hydro >= 4 and $self->hydro <= 8
$self->atmosphere >= 4 and $self->atmosphere <= 9 and $self->hydro >= 4
$self->atmosphere >= 4 and $self->atmosphere <= 9
MC/DC0%0/6
$self->atmosphere >= 4 and $self->atmosphere <= 9 and $self->hydro >= 4 and $self->hydro <= 8 and $self->population >= 5 and $self->population <= 7
$self->atmosphere >= 4
$self->atmosphere <= 9
$self->hydro >= 4
$self->hydro <= 8
$self->population >= 5
$self->population <= 7
Truth table0%0/7
A and B and C and D and E and F
A= $self->atmosphere >= 4B= $self->atmosphere <= 9C= $self->hydro >= 4D= $self->hydro <= 8E= $self->population >= 5F= $self->population <= 7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | and $self->hydro >= 4 and $self->hydro <= 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | and $self->population >= 5 and $self->population <= 7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | $tradecodes .= ' As' if $self->size == 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->size == 0 and $self->atmosphere == 0 and $self->hydro == 0
$self->size == 0 and $self->atmosphere == 0
MC/DC0%0/3
$self->size == 0 and $self->atmosphere == 0 and $self->hydro == 0
$self->size == 0
$self->atmosphere == 0
$self->hydro == 0
Truth table0%0/4
A and B and C
A= $self->size == 0B= $self->atmosphere == 0C= $self->hydro == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | and $self->atmosphere == 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | and $self->hydro == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | $tradecodes .= ' Ba' if $self->population == 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->population == 0 and $self->government == 0 and $self->law == 0
$self->population == 0 and $self->government == 0
MC/DC0%0/3
$self->population == 0 and $self->government == 0 and $self->law == 0
$self->population == 0
$self->government == 0
$self->law == 0
Truth table0%0/4
A and B and C
A= $self->population == 0B= $self->government == 0C= $self->law == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | and $self->government == 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | and $self->law == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | $tradecodes .= ' De' if $self->atmosphere >= 2 and $self->hydro == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->atmosphere >= 2 and $self->hydro == 0
MC/DC0%0/2
$self->atmosphere >= 2 and $self->hydro == 0
$self->atmosphere >= 2
$self->hydro == 0
Truth table0%0/3
A and B
A= $self->atmosphere >= 2B= $self->hydro == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | $tradecodes .= ' Fl' if $self->atmosphere =~ /^[ABC]$/ # erratum | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->atmosphere =~ /^[ABC]$/u and $self->hydro >= 1
MC/DC0%0/2
$self->atmosphere =~ /^[ABC]$/u and $self->hydro >= 1
$self->atmosphere =~ /^[ABC]$/u
$self->hydro >= 1
Truth table0%0/3
A and B
A= $self->atmosphere =~ /^[ABC]$/uB= $self->hydro >= 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | and $self->hydro >= 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | $tradecodes .= ' Hi' if $self->population >= 9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | $tradecodes .= ' Ic' if $self->atmosphere <= 1 and $self->hydro >= 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->atmosphere <= 1 and $self->hydro >= 1
MC/DC0%0/2
$self->atmosphere <= 1 and $self->hydro >= 1
$self->atmosphere <= 1
$self->hydro >= 1
Truth table0%0/3
A and B
A= $self->atmosphere <= 1B= $self->hydro >= 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | $tradecodes .= ' In' if $self->atmosphere =~ /^[012479]$/ and $self->population >= 9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->atmosphere =~ /^[012479]$/u and $self->population >= 9
MC/DC0%0/2
$self->atmosphere =~ /^[012479]$/u and $self->population >= 9
$self->atmosphere =~ /^[012479]$/u
$self->population >= 9
Truth table0%0/3
A and B
A= $self->atmosphere =~ /^[012479]$/uB= $self->population >= 9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | $tradecodes .= ' Lo' if $self->population <= 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | $tradecodes .= ' Na' if $self->atmosphere <= 3 and $self->hydro <= 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->atmosphere <= 3 and $self->hydro <= 3 and $self->population >= 6
$self->atmosphere <= 3 and $self->hydro <= 3
MC/DC0%0/3
$self->atmosphere <= 3 and $self->hydro <= 3 and $self->population >= 6
$self->atmosphere <= 3
$self->hydro <= 3
$self->population >= 6
Truth table0%0/4
A and B and C
A= $self->atmosphere <= 3B= $self->hydro <= 3C= $self->population >= 6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | and $self->population >= 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | $tradecodes .= ' Ni' if $self->population <= 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | $tradecodes .= ' Po' if $self->atmosphere >= 2 and $self->atmosphere <= 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->atmosphere >= 2 and $self->atmosphere <= 5 and $self->hydro <= 3
$self->atmosphere >= 2 and $self->atmosphere <= 5
MC/DC0%0/3
$self->atmosphere >= 2 and $self->atmosphere <= 5 and $self->hydro <= 3
$self->atmosphere >= 2
$self->atmosphere <= 5
$self->hydro <= 3
Truth table0%0/4
A and B and C
A= $self->atmosphere >= 2B= $self->atmosphere <= 5C= $self->hydro <= 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | and $self->hydro <= 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | $tradecodes .= ' Ri' if $self->atmosphere =~ /^[68]$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/12
$self->atmosphere =~ /^[68]$/u and $self->population >= 6 and $self->population <= 8 and $self->government >= 4 and $self->government <= 9
$self->atmosphere =~ /^[68]$/u and $self->population >= 6 and $self->population <= 8 and $self->government >= 4
$self->atmosphere =~ /^[68]$/u and $self->population >= 6 and $self->population <= 8
$self->atmosphere =~ /^[68]$/u and $self->population >= 6
MC/DC0%0/5
$self->atmosphere =~ /^[68]$/u and $self->population >= 6 and $self->population <= 8 and $self->government >= 4 and $self->government <= 9
$self->atmosphere =~ /^[68]$/u
$self->population >= 6
$self->population <= 8
$self->government >= 4
$self->government <= 9
Truth table0%0/6
A and B and C and D and E
A= $self->atmosphere =~ /^[68]$/uB= $self->population >= 6C= $self->population <= 8D= $self->government >= 4E= $self->government <= 9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | and $self->population >= 6 and $self->population <= 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | and $self->government >= 4 and $self->government <= 9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | $tradecodes .= ' Va' if $self->atmosphere == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | $tradecodes .= ' Wa' if $self->hydro == 10; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | return $tradecodes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||