A computerized version of the Avalon Hill Company board game
When I was a young teenager I bought a board game called Statis Pro Baseball. Already curious about baseball stats, I was excited at the opportunity to play a game that used professional baseball players' statistics to decide the outcome of the game. By using specific formula's rendering numbers between 11 and 88, batting and pitching cards were produced for each individual player. The range of numbers are divided across multiple variables from hitting (singles to HRs), running (runs scored, stealing bases, special teams play), strikeouts, walks etc depending upon the statistics of a given player. Hence, great players were more likely to produce great plays and lesser players, less likely so. The whole game is based upon probability which really drew me more into the subject of math! I simulated seasons and ended up playing over 1000 games. When I discoverd computing, I decided one day I'd develop a computerized version.
As this is a copyrighted game (and assume the rights belong to Wizards of the Coast who are now a the sucessor), I am not willing to make all the code available. If anyone who holds the rights of this game want me to remove it from Github, I will gladly do so.
This is still a work in progress, but I hope to have an up and running version soon enough!
Here, I provide the code used to produce batting and pitching cards. The formulas are provided as part of the instructions in the game. Typically stats are used for a given season to produce the cards, but I feel sometimes it can be a little unfair if a current player is injured for that season, so I produced the option to produce cards based on average stats over multiple seasons. The statistics I have used have come from the very excellent website by Sean Lahman (http://www.seanlahman.com/baseball-archive/statistics/) (Thank you Sean!). I have used his excel sheets for this purpose, but SQL is also supported and can beasily implemented. Future renditions of this code I hope to be written using the Pandas library for easier database reading.