# implements the game Petals Around the Rose # no arguments will roll 5 six sided die and report the score # help will report the three things that a human is allowed to tell a human player: # 1) The name of the game is Petals Around the Rose. # 2) The name of the game is important. # 3) The score will always be zero or an even number. # and report that the goal is to work out how to calculate the score use Getopt::Long; use A_Die; use Dice; my @args; @args = [@ARGV]; Getopt::Long::Configure("prefix_pattern=--|-|\/"); my $opt_help=''; GetOptions('help|?'=>\$opt_help); usage() if $opt_help; my $i; my $dice; my $die; my $answer; $dice = Dice->new(); $answer = 0; for $i (1..5) { $die = $dice->add_die(); $roll = $die->value; $answer += $roll -1 if int($roll / 2) != ($roll / 2); } print $dice->toTextArt(); print "\nThe score is ",$answer,"\n"; sub usage { print "\nUsage: \n"; print "\t",$0," [/?]\n\n"; print <