engine
https://gist.github.com/b1a4440aebe8e7dc0d874cfbce457479.git
main
https://gist.github.com/df25b31531621cddd6a6d5804150c5d4.git
To be honest, I’m writing from South Korea. Since English isn't my first
language, I’ve been using Gemini to help translate my thoughts into these posts. Following my previous update, I’ve spent several hours battling errors to refine the game logic and carefully adding detailed commentary to the code. I considered translating the comments into English, but Gemini suggested keeping them in Korean—it adds a unique touch, and those truly interested will find a way to translate and understand the logic.
Building on the previous version, I’ve now implemented the logic for the game to end if the home team is leading after the top of the 9th, as well as "walk-off" (Sayonara) scenarios for the bottom of the 9th. I’ve also finalized the probability settings for each team, covering batting averages, walks, outs, and various types of hits.
The "walk-off hit" logic is still a work in progress. Ideally, the game should end the moment the winning runner touches home plate. However, implementing this requires a system to track each individual runner's position, so I've decided to tackle that in a future update to focus on simpler milestones first. Currently, a walk-off hit behaves a bit like a home run, where trailing runners might still be included in the final score—a small detail I look forward to perfecting soon.
I’m consistently posting here because my goal is to become a skilled developer, work abroad, or be invited to collaborate on global projects. It’s a long journey, but with the support of my followers and readers, I feel like I’m getting closer every day. I appreciate your continued interest and will keep sharing my progress.
How to use: In the 2nd line of the main file, please update the filename next to from to match your local environment.

Top comments (0)