Actions

start:        die  /^\Z/         {$item [1]}

die:          'd' number         {1 + int rand $item [2]}
            | number 'd' number  {my $s = 0;
                                  foreach (1 .. $item [1]) {
                                     $s += 1 + int rand $item [3]
                                  }
                                  $s}

number:       /\d+/

[Prev] [Next] [Index]