Day 19 – Much accomplished!

I’ve had a very productive day on my RetroChallenge project. The following items were coded from the to do list:

1. Defensive team team ratings
a. calculate for roster
b. update ratings for change of roster, or player change of position

2. Stealing of 3rd base and home, based on steal charts (copied from steal of first base and modified)

3. Pitcher card outcomes
a. regular outcomes, ground out, strike out, walk etc.
b. Team Defense automatic Outs
c. X-chart – special plays: wild pitch, Hit by ptich, Balk, Passed Ball

4. Logic for walks, Balks, Hit by Pitch, Passed Ball – to advance runners, score runners

5. Corrected some bugs:
a. Not removing >> when not confirming swap of players
b. not correctly allow change of position for outfield due to user defined characters

6. Added team name to roster screen (Home or Visitor)

Much of the coding is for play logic and not very visual, however here’s details on a couple of the items from above:

Position and defensive rating in data
Position and defensive rating in data

In the picture above highlighted is the defensive rating for Honus Wagner for SS, each player has rating for each position that he can play.  The team total is the sum for the 8 position players.  in the picture below you can see the team name and team total defensive rating is displayed.  Logic was also added to adjust the defensive rating when players or positions are changed.

Team name and Team Defensive rating added to roster screen
Team name and Team Defensive rating added to roster screen

The way these rating is used is when a roll of 10 to 15 occurs when the pitching stats are accessed during an at bat.  The chart below shows which rolls are automatic, as you can seen the larger the team defensive rating the more rolls that result in automatic outs.

Team Defensive Chart
Team Defensive Chart

And here is the logic to determine if there is an auto out or batter gets to swing:

BASIC code for Team Defense
BASIC code for Team Defense
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s