5 die "Usage: $0 boss_atk boss_hp [my_hp] [my_atk]\n" if @ARGV < 2;
6 my ($batk,$bhp,$myhp,$myatk)=@ARGV;
8 $tmp .= ", MyHP:$myhp" if $myhp;
9 $tmp .= ", MyATK:$myatk" if $myatk;
10 print "Input: BossATK:$batk, BossHP:$bhp$tmp\n";
15 my $Times = int(1+ $MaxHP / $batk);
16 for my $times ( 1 .. $Times) {
17 my $needATK = int(1+ $bhp / $times);
18 my $minHP = $batk * $times;
19 next if $needATK > $MaxATK;
20 last if $myhp and 3*$myhp < $minHP;
22 if ($times>1 and $myhp and $myhp > $minHP) {
23 my $maxBossATK = int($myhp/$times);
24 $tmp .= "\tMaxBossATK: $maxBossATK";
27 my $maxBossHP = 2*$myatk*$times;
28 $tmp .= "\tMaxBossHP: $maxBossHP (2x)";
30 print "Times: $times\tHP: $minHP\tAtk: ".int(1+$needATK/3),"(x3) ",int(1+$needATK/2),"(x2) $needATK(x1)$tmp\n";