This is an interesting idea. With just a bit of enhancement you could have it so it will (in increasing amount of difficulty) :
1) randomly calculate for a hit also -- so it's not just a strike-out or walk
2) automatically select two real MLB teams and list them as playing
3) put a timer in so it "plays" an entire game and the user can just watch.
Nice idea and article. thanks for sharing
Sometimes when I’m alone in my room I write software... it’s for fun. I’m a father but I’m not like all up in your face about it. | 🤘 Metal 🤘| Pro-Am Chef
Location
Denver, CO
Education
Not really
Work
Full-Stack Developer / DevOps Strategist at Envision Radiology
Yeah, that makes sense. I think it's because the article didn't mention the possibility of a hit, just this :
Then a random number generator will either make that pitch a "strike", or a "ball". Once you get to 4 balls the batter is "walked". If you get 3 "strikes" the batter is out.
Sometimes when I’m alone in my room I write software... it’s for fun. I’m a father but I’m not like all up in your face about it. | 🤘 Metal 🤘| Pro-Am Chef
Location
Denver, CO
Education
Not really
Work
Full-Stack Developer / DevOps Strategist at Envision Radiology
One of the things I thought of doing is have a "Team" array with Players that all have different ratings. So like in REAL baseball a batter with a .500 average is going to get more hits than a batter with a .300 average. I thought about factoring in that percentage. Then you could let them pick their own team by having a maximum number of "points". Maybe you start with 20 points. A batter with a .500 average is 10 points so that would be almost all of your points so you would have to fill your roster with .125 average batters. So there would be some skill in optimizing your roster of players.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is an interesting idea. With just a bit of enhancement you could have it so it will (in increasing amount of difficulty) :
1) randomly calculate for a hit also -- so it's not just a strike-out or walk
2) automatically select two real MLB teams and list them as playing
3) put a timer in so it "plays" an entire game and the user can just watch.
Nice idea and article. thanks for sharing
It already calculates for a hit. How would there be any runs if there are not hits. 😂
There is a random chance of:
It will actually advance innings and score runs if there are more than 3 hits in an inning.
Yeah, that makes sense. I think it's because the article didn't mention the possibility of a hit, just this :
One of the things I thought of doing is have a "Team" array with Players that all have different ratings. So like in REAL baseball a batter with a .500 average is going to get more hits than a batter with a .300 average. I thought about factoring in that percentage. Then you could let them pick their own team by having a maximum number of "points". Maybe you start with 20 points. A batter with a .500 average is 10 points so that would be almost all of your points so you would have to fill your roster with .125 average batters. So there would be some skill in optimizing your roster of players.