Class PitchingChart

java.lang.Object
PitchingChart

public final class PitchingChart extends Object
First Roll of the Simulation resulting in one of four outcomes "WALK","OVERS","CORNERS","STRIKE OUT".
WALK and STRIKE OUT ends the batter's plate appearance.
OVERS and CORNERS result in additonal rolls.
Version:
3-14-24
Author:
L Kedigh
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static Random
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getPitchRollResult(int pitchingFactor, char battersBattingSide)
    First roll of the appearance resulting in either "WALK","OVERS","CORNERS","STRIKE OUT"
    static void
    setPitchingLimits(int pitchingFactor, char batterSide)
    Determines the pitching chart limits based on the pitcher's pitching factor and the side of the plate the hitter is hitting from.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • PitchingChart

      public PitchingChart()
  • Method Details

    • getPitchRollResult

      public static String getPitchRollResult(int pitchingFactor, char battersBattingSide)
      First roll of the appearance resulting in either "WALK","OVERS","CORNERS","STRIKE OUT"
      Parameters:
      pitchingFactor - Pitcher pitching factor, 10-29 inclusive.
      batSide - Batter's side of the plate they hit from.
      Returns:
      One of the following "WALK","OVERS","CORNERS","STRIKE OUT"
    • setPitchingLimits

      public static void setPitchingLimits(int pitchingFactor, char batterSide)
      Determines the pitching chart limits based on the pitcher's pitching factor and the side of the plate the hitter is hitting from.
      The limits represent the values that mark "WALK","OVERS","CORNERS","STRIKE OUT" results.
      Example A pitching factor of 19 has different limits based on pitching to a left handed batter or a right handed batter.
      A pitching factor of 19 will result in 190 for left handed batters, and 191 for right handed batters.