Giter Site home page Giter Site logo

tearitco / baseball-simulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benryan03/baseball-simulator

0.0 0.0 0.0 280 KB

A command-line baseball simulator in Python. Choose two MLB teams from any year with historically accurate rosters, and watch them go head to head! Players unique stats are taken into account during each pitcher-batter matchup.

Python 100.00%

baseball-simulator's Introduction

Baseball Simulator is a Python command-line program that simulates a complete 
baseball game.

Game demo: https://youtu.be/YLm9Nl_hyu4

The user is prompted to choose any two MLB teams, and the year for each team. 
The program then scrapes player data from baseball-reference.com.

The program attempts to be as accurate as possible to real-world outcomes. 
Data from the following sources was used to refine the algorithms that 
determine results:

https://www.baseball-reference.com/leagues/MLB/bat.shtml
https://www.baseball-fever.com/forum/general-baseball/statistics-analysis-sabermetrics/81427-pitch-outcome-distribution-over-25-years
https://www.baseballprospectus.com/news/article/8936/prospectus-idol-entry-grounding-home-run-hitters/

For each at-bat, the program takes into account the batter's batting average, 
the pitcher's earned run average, and the pitcher's pitch count to determine 
whether the batter or pitcher has an edge, and how big of an edge. A player 
with an edge over the other will be more likely to have a positive result for 
each pitch, and that likelihood increases with larger edge percentages.

At the end of each game, the program will output a box score, and give the 
user the option to save the box score to a .txt file.

baseball-simulator's People

Contributors

benryan03 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.