Baseball Game Rules & Inning Flow
Game Setup
Pre-Game Selection
- Player Assignment
- Player 1: HOME team
- Player 2: AWAY team (VISITOR)
- Game Initialization
- Starting inning: 1
- Home team score: 0
- Away team score: 0
- All bases empty (1st, 2nd, 3rd)
- Outs: 0
- Balls: 0
- Strikes: 0
Inning Structure
Each inning consists of two half-innings:
- TOP of inning - Away team (Player 2) bats
- BOTTOM of inning - Home team (Player 1) bats
Half-Inning Flow (One Team Batting)
Before First Batter
- Reset outs to 0
- Reset balls to 0
- Reset strikes to 0
- Bases remain as they were (runners carry over from previous at-bats)
- Display: "TOP of Inning X - AWAY batting" OR "BOTTOM of Inning X - HOME batting"
Each At-Bat (One Batter's Turn)
Step 1: Roll Dice
- Player whose team is batting clicks "Roll Dice"
- System generates two random dice (1-6 each)
- Display: "Die 1: X, Die 2: Y"
Step 2: Look Up Outcome
- Match dice roll to outcome table
- Determine result (Hit, Walk, Out, etc.)
Step 3: Process Result Based on Outcome Type
IF OUTCOME = SINGLE:
- Batter advances to 1st base
- Runner on 1st → advances to 2nd base
- Runner on 2nd → advances to 3rd base
- Runner on 3rd → scores 1 run (add to batting team's score)
- Update display: show all runners' new positions
IF OUTCOME = DOUBLE:
- Batter advances to 2nd base
- Runner on 1st → advances to 3rd base
- Runner on 2nd → scores 1 run
- Runner on 3rd → scores 1 run
- Update display: show all runners' new positions
IF OUTCOME = TRIPLE:
- Batter advances to 3rd base
- Runner on 1st → scores 1 run
- Runner on 2nd → scores 1 run
- Runner on 3rd → scores 1 run
- Update display: show all runners' new positions
IF OUTCOME = HOME RUN:
- Batter scores 1 run
- Runner on 1st → scores 1 run
- Runner on 2nd → scores 1 run
- Runner on 3rd → scores 1 run
- Total runs scored: 1 + number of runners on base
- Clear all bases (all runners scored)
- Update display: show all bases now empty
IF OUTCOME = WALK:
- Batter advances to 1st base
- Runner on 1st → advances to 2nd base ONLY if there's a runner on 1st (forced advance)
- Runner on 2nd → advances to 3rd base ONLY if there's a runner on 2nd (forced advance)
- Runner on 3rd → scores 1 run ONLY if bases are loaded (forced advance)
- Update display: show all runners' new positions
IF OUTCOME = SACRIFICE FLY:
- Increment outs by 1
- Batter does NOT reach base
- Runner on 1st → advances to 2nd base
- Runner on 2nd → advances to 3rd base
- Runner on 3rd → scores 1 run
- Display: "Sacrifice Fly - Out (runners advance)"
IF OUTCOME = FLY OUT, GROUND OUT, or POP OUT:
- Increment outs by 1
- Runners do NOT advance (stay in same position)
- Batter does not reach base
- Display outcome name and "Out"
IF OUTCOME = STRIKE OUT:
- Increment outs by 1
- Runners do NOT advance
- Batter does not reach base
- Display: "Strike Out - Out"
Step 4: Update Score Display
- Show current inning
- Show HOME team score
- Show AWAY team score
- Show current bases (with runners or empty)
- Show outs count (0, 1, or 2)
Step 5: Check for End of Half-Inning
- If outs = 3:
- Clear all runners from bases
- Reset outs to 0
- Move to next half-inning (see below)
- Display: "End of half-inning - switching sides"
- If outs < 3:
- Next batter steps up
- Return to Step 1 (Roll Dice)
Half-Inning Transitions
After Top of Inning (Away team finishes batting):
- Display: "Bottom of Inning X - HOME batting"
- Prompt Player 1 to roll
After Bottom of Inning (Home team finishes batting):
- Check if more innings needed
- If Inning < 9 (or whatever max):
- Increment inning counter
- Display: "Top of Inning X+1 - AWAY batting"
- Prompt Player 2 to roll
- If Inning = 9 (or max):
- Go to End Game (see below)
Game End Conditions
End of Regulation (9 Innings)
After Bottom of Inning 9 completes:
- Compare scores:
- If HOME score > AWAY score: HOME team wins → Display final score and winner
- If AWAY score > HOME score: AWAY team wins → Display final score and winner
- If scores are tied: Continue to Extra Innings (proceed to Inning 10, 11, etc.)
Extra Innings (Inning 10+)
Extra innings follow the same rules as innings 1-9:
- Top of inning: AWAY bats
- Bottom of inning: HOME bats
- First team to score during their at-bat while ahead wins
- Continue until one team has more runs after both teams complete an inning
Game ends when:
- After Bottom of an inning, HOME score > AWAY score, OR
- After Top of an inning, AWAY score > HOME score (HOME hasn't batted yet in that inning, so game is decided)
- Display final score, winning team, and inning in which game ended
- Offer option to start new game
Data to Track Throughout Game
- Inning number (1-9+, continues in extra innings)
- Half-inning (Top or Bottom)
- Active batting team (Home or Away)
- HOME team score (cumulative runs)
- AWAY team score (cumulative runs)
- Outs in current half-inning (0, 1, or 2)
- Base runners (Runner on 1st, 2nd, 3rd - use generic names like "Runner A", "Runner B", etc.)
- Each runner tracks which base they're currently on
- Current at-bat history (optional: log of each result for review)
Key Rules Summary
- Three outs per half-inning - batting team switches when 3 outs occur
- Runners advance based on hit type - see above for each outcome
- Runners do NOT advance on outs (except sacrifice fly doesn't make them advance either)
- Runs score when runner reaches home plate - happens via advancing on hits
- Forced advances on walks - if bases loaded, runner on 3rd must score
- Game is 9 innings - (can be configured)
- Home team bats last - Top half = Away, Bottom half = Home (Away gets last chance to score)
Rules Confirmed
- No ties: Game continues into extra innings if tied after 9 innings
- Generic runner names: Use generic identifiers (Runner A, Runner B, etc.) rather than tracking individual player names
- Sacrifice fly: Batter is out, but all other runners advance by 1 base (runner on 3rd scores)
← Return to Baseball Game