<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: sm.lee</title>
    <description>The latest articles on Forem by sm.lee (@lee12).</description>
    <link>https://forem.com/lee12</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3821135%2Fcec70a85-fddb-4ad2-92e4-39dee66967ce.png</url>
      <title>Forem: sm.lee</title>
      <link>https://forem.com/lee12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lee12"/>
    <language>en</language>
    <item>
      <title>Refactoring for Scalability: Implementing a 16-Team Tournament Logic in Python</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Mon, 30 Mar 2026 05:17:25 +0000</pubDate>
      <link>https://forem.com/lee12/refactoring-for-scalability-implementing-a-16-team-tournament-logic-in-python-2p36</link>
      <guid>https://forem.com/lee12/refactoring-for-scalability-implementing-a-16-team-tournament-logic-in-python-2p36</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com/239ad492cbc875f802e6d5facf35db81.git" rel="noopener noreferrer"&gt;https://gist.github.com/239ad492cbc875f802e6d5facf35db81.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To bring my baseball project to a full league scale, I've been working on a tournament simulation engine. It currently features a Round of 16 group stage, a bracket for the Quarter-finals and Semi-finals, and a Best-of-five Series for the Grand Finals. I'm still tweaking the fine-grained league regulations, but I wanted to share the progress so far.&lt;/p&gt;

&lt;p&gt;To run the simulation, simply copy and paste the code into your Python environment and execute it.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>gamedev</category>
      <category>learning</category>
    </item>
    <item>
      <title>I built a baseball simulator in Python (with JSON-based teams)</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Wed, 25 Mar 2026 07:37:26 +0000</pubDate>
      <link>https://forem.com/lee12/i-built-a-baseball-simulator-in-python-with-json-based-teams-407d</link>
      <guid>https://forem.com/lee12/i-built-a-baseball-simulator-in-python-with-json-based-teams-407d</guid>
      <description>&lt;p&gt;engine&lt;br&gt;
&lt;a href="https://gist.github.com/ccf99187f6f438d18dae7adeafd584ab.git" rel="noopener noreferrer"&gt;https://gist.github.com/ccf99187f6f438d18dae7adeafd584ab.git&lt;/a&gt;&lt;br&gt;
main&lt;br&gt;
&lt;a href="https://gist.github.com/b6b79da45e8d896212a5b3b4214919b9.git" rel="noopener noreferrer"&gt;https://gist.github.com/b6b79da45e8d896212a5b3b4214919b9.git&lt;/a&gt;&lt;br&gt;
Teams&lt;br&gt;
&lt;a href="https://gist.github.com/64f40cf6a132812f2e7522333e2ddd62.git" rel="noopener noreferrer"&gt;https://gist.github.com/64f40cf6a132812f2e7522333e2ddd62.git&lt;/a&gt;&lt;br&gt;
teams&lt;br&gt;
&lt;a href="https://gist.github.com/863bde9738786ce7073b04c5504416e3.git" rel="noopener noreferrer"&gt;https://gist.github.com/863bde9738786ce7073b04c5504416e3.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's been just over two weeks since I started building my baseball simulation. I'll admit, the sheer difficulty of development has dampened my spirits at times. But I’m sticking to my '1% improvement' philosophy—challenging myself consistently, even if it's just a little bit each day.&lt;/p&gt;

&lt;p&gt;I’ve refactored the project structure as follows:&lt;/p&gt;

&lt;p&gt;Previous Structure:&lt;/p&gt;

&lt;p&gt;Team files&lt;/p&gt;

&lt;p&gt;Main (Execution)&lt;/p&gt;

&lt;p&gt;Team Stats + Load Team + Prepare Next Batter (Combined)&lt;/p&gt;

&lt;p&gt;New Refactored Structure:&lt;/p&gt;

&lt;p&gt;Team files&lt;/p&gt;

&lt;p&gt;Main (Execution)&lt;/p&gt;

&lt;p&gt;Team Stats (Separated)&lt;/p&gt;

&lt;p&gt;Load Team + Prepare Next Batter (Separated)&lt;/p&gt;

&lt;p&gt;The reason for this separation is to minimize potential errors and ensure scalability as I add more teams to the simulation.&lt;/p&gt;

&lt;p&gt;During this process, I faced numerous challenges—from base-stealing bugs to countless errors during the file separation phase. There were moments when I felt like giving up, but I pushed through by focusing on solving just one immediate error at a time.&lt;/p&gt;

&lt;p&gt;I’m also learning a lot from AI about system architecture, file modularization, and how to improve overall code quality. A huge thank you to my followers and everyone who takes the time to read my posts!&lt;/p&gt;

&lt;p&gt;[How to Run]&lt;br&gt;
Please save the engine, main, Teams, and teams files separately. In the main file, update the from statements with the specific names of the engine and Teams files you are using before executing main.&lt;/p&gt;

</description>
      <category>python</category>
      <category>learning</category>
      <category>beginners</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Is this "Nano Banana" image for real?</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Sun, 22 Mar 2026 22:59:54 +0000</pubDate>
      <link>https://forem.com/lee12/is-this-nano-banana-image-for-real-47f5</link>
      <guid>https://forem.com/lee12/is-this-nano-banana-image-for-real-47f5</guid>
      <description>&lt;p&gt;I’m currently in the middle of a fierce battle to integrate graphics into my baseball simulation project and bring the game to life.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm33luy0o31tnctkwqck.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm33luy0o31tnctkwqck.jpg" alt=" " width="128" height="128"&gt;&lt;/a&gt;&lt;br&gt;
I specifically requested a certain composition from the AI to achieve this look.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F539fyydme41dkifm99jk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F539fyydme41dkifm99jk.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
My specific request was for a teddy bear in this exact composition, but it just lazily stuck on two ears and decided that was enough.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flqzhsbzhflwtorrilf1d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flqzhsbzhflwtorrilf1d.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
I was going for that adorable teddy bear look, but once again, the AI gave me... well, this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ubmj3qtag31s7mpfl9p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ubmj3qtag31s7mpfl9p.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2jbikggdus7i4qir5ne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2jbikggdus7i4qir5ne.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
Even after trying for that cute teddy bear aesthetic, the AI keeps messing up the spatial logic—placing the pitcher, batter, and umpire in ways that just don't make sense. It's a constant process of 'prompt engineering' to see how I can get the AI to actually understand the baseball field layout I want.&lt;/p&gt;

</description>
      <category>python</category>
      <category>gamedev</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Refactoring Struggles: Successfully Modularized, But Hitting a Wall with Scalability</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Sat, 21 Mar 2026 05:51:58 +0000</pubDate>
      <link>https://forem.com/lee12/refactoring-struggles-successfully-modularized-but-hitting-a-wall-with-scalability-2fk4</link>
      <guid>https://forem.com/lee12/refactoring-struggles-successfully-modularized-but-hitting-a-wall-with-scalability-2fk4</guid>
      <description>&lt;p&gt;main&lt;br&gt;
&lt;a href="https://gist.github.com/5c0c1c7ff0892e0a14175f7d99350d15.git" rel="noopener noreferrer"&gt;https://gist.github.com/5c0c1c7ff0892e0a14175f7d99350d15.git&lt;/a&gt;&lt;br&gt;
engine&lt;br&gt;
&lt;a href="https://gist.github.com/2ad8c7eea57128cfcbaa261385a1a4f0.git" rel="noopener noreferrer"&gt;https://gist.github.com/2ad8c7eea57128cfcbaa261385a1a4f0.git&lt;/a&gt;&lt;br&gt;
teams&lt;br&gt;
&lt;a href="https://gist.github.com/15e234746f5d4d5026158c4671d599dc.git" rel="noopener noreferrer"&gt;https://gist.github.com/15e234746f5d4d5026158c4671d599dc.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnquic4fzell86vnvuio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnquic4fzell86vnvuio.png" alt=" " width="800" height="334"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0n4zlgbzcruppym5tie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0n4zlgbzcruppym5tie.png" alt=" " width="800" height="258"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh235g6qrwewb42cb69aa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh235g6qrwewb42cb69aa.png" alt=" " width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today, I attempted a major refactoring of my project files. I successfully separated the code into three main files: engine, main, and teams. However, my next goal—splitting the teams file into individual files for each team to allow for easier expansion—proved to be a formidable challenge.&lt;/p&gt;

&lt;p&gt;I spent 3 to 4 hours battling persistent errors, but ultimately, the attempt was unsuccessful. To truly master refactoring, I’ve realized I need to go back to simpler simulations, re-evaluate if my logic aligns with how the machine processes data, and then see if those principles can be applied to my current project.&lt;/p&gt;

&lt;p&gt;I’ve heard that sharing failed attempts can be just as helpful as sharing successes, so I am posting my current progress here. A huge thank you to all my followers and readers for your continuous support.&lt;/p&gt;

&lt;p&gt;PS: To run this, copy the code from the three links into separate Python files. In your main file, update the from statements to match the filenames of your engine and teams files in your local environment.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>gamedev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Refining Baseball Logic: Inning Closures, Probabilities, and the Challenge of</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Fri, 20 Mar 2026 07:08:33 +0000</pubDate>
      <link>https://forem.com/lee12/refining-baseball-logic-inning-closures-probabilities-and-the-challenge-of-3c9j</link>
      <guid>https://forem.com/lee12/refining-baseball-logic-inning-closures-probabilities-and-the-challenge-of-3c9j</guid>
      <description>&lt;p&gt;engine&lt;br&gt;
&lt;a href="https://gist.github.com/b1a4440aebe8e7dc0d874cfbce457479.git" rel="noopener noreferrer"&gt;https://gist.github.com/b1a4440aebe8e7dc0d874cfbce457479.git&lt;/a&gt;&lt;br&gt;
main&lt;br&gt;
&lt;a href="https://gist.github.com/df25b31531621cddd6a6d5804150c5d4.git" rel="noopener noreferrer"&gt;https://gist.github.com/df25b31531621cddd6a6d5804150c5d4.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9msr75jvc9jawv51ggf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9msr75jvc9jawv51ggf.png" alt=" " width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To be honest, I’m writing from South Korea. Since English isn't my first &lt;br&gt;
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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;How to use: In the 2nd line of the main file, please update the filename next to from to match your local environment.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>gamedev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Python Baseball Engine Update: How to Separate Game Logic from UI</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Thu, 19 Mar 2026 21:38:19 +0000</pubDate>
      <link>https://forem.com/lee12/python-baseball-engine-update-how-to-separate-game-logic-from-ui-1bd8</link>
      <guid>https://forem.com/lee12/python-baseball-engine-update-how-to-separate-game-logic-from-ui-1bd8</guid>
      <description>&lt;p&gt;engine&lt;br&gt;
&lt;a href="https://gist.github.com/71b4fa98b36ce1c4d1ca10f78b383e56.git" rel="noopener noreferrer"&gt;https://gist.github.com/71b4fa98b36ce1c4d1ca10f78b383e56.git&lt;/a&gt;&lt;br&gt;
main&lt;br&gt;
&lt;a href="https://gist.github.com/6067572dc747d5e142a2915121c15a4a.git" rel="noopener noreferrer"&gt;https://gist.github.com/6067572dc747d5e142a2915121c15a4a.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To truly master coding, I am focusing on understanding every single line of code and writing detailed explanations for each one.&lt;/p&gt;

&lt;p&gt;In this update, I’ve added the logic for switching sides (innings) once three outs are reached. More importantly, I have separated the code into two parts: the Engine, which handles the core game logic, and the Main (Execution), which handles the user interface.&lt;/p&gt;

&lt;p&gt;I plan to keep pushing forward and improving this project, so please stay tuned for more! A huge thank you to all my followers and readers for your support.&lt;/p&gt;

&lt;p&gt;PS: To run this, save the Engine and Main as separate Python files. In the second line of the Main file, make sure to update the from [filename] import Baseball statement to match your Engine's filename. Then, you're all set to play!&lt;/p&gt;

</description>
      <category>python</category>
      <category>gamedev</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Detailed commentary to every line</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Thu, 19 Mar 2026 04:01:23 +0000</pubDate>
      <link>https://forem.com/lee12/detailed-commentary-to-every-line-59il</link>
      <guid>https://forem.com/lee12/detailed-commentary-to-every-line-59il</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com/fb98eb9d932bbdab90538a5d54726536.git" rel="noopener noreferrer"&gt;https://gist.github.com/fb98eb9d932bbdab90538a5d54726536.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have officially completed the study of the remaining parts of the logic and added detailed commentary to every line of the code. It was a great journey of breaking down each function to truly understand how the engine works.&lt;/p&gt;

&lt;p&gt;A huge thank you to all my followers and everyone who has been following this series. Your support keeps me motivated! Happy coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>gamedev</category>
      <category>beginners</category>
      <category>baseball</category>
    </item>
    <item>
      <title>Update: Refining the Base Running Logic for a 'Base on Balls' (Walk)</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Thu, 19 Mar 2026 00:26:57 +0000</pubDate>
      <link>https://forem.com/lee12/update-refining-the-base-running-logic-for-a-base-on-balls-walk-bf0</link>
      <guid>https://forem.com/lee12/update-refining-the-base-running-logic-for-a-base-on-balls-walk-bf0</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com/ae32fe94c7d178d3ddfd9f635293f494.git" rel="noopener noreferrer"&gt;https://gist.github.com/ae32fe94c7d178d3ddfd9f635293f494.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m sharing an updated file that specifically focuses on the 'Base Running Logic during a Walk' (Base on Balls), along with detailed commentary. I’ve included a step-by-step breakdown within the code to explain the 'chain reaction' of forced runner movement and how each base is cleared and re-occupied.&lt;/p&gt;

&lt;p&gt;A huge thank you to all my followers and everyone who has been following my progress. Happy coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>gamedev</category>
      <category>beginners</category>
      <category>baseball</category>
    </item>
    <item>
      <title>How I Mastered Baseball Simulation Logic: A Step-by-Step Breakdown</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Wed, 18 Mar 2026 20:24:34 +0000</pubDate>
      <link>https://forem.com/lee12/title-how-i-mastered-baseball-simulation-logic-a-step-by-step-breakdown-gih</link>
      <guid>https://forem.com/lee12/title-how-i-mastered-baseball-simulation-logic-a-step-by-step-breakdown-gih</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com/f1d4a15db7c02052fc9a9e0783fab79c.git" rel="noopener noreferrer"&gt;https://gist.github.com/f1d4a15db7c02052fc9a9e0783fab79c.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today, I took a deep dive into the base_running logic of my Python baseball simulation. At first, the code felt like a black box, but by breaking it down line by line and using metaphors like "Excel SUM," I finally claimed ownership of the logic. Here is how it works.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The "Clean Slate" Strategy (scored = 0)&lt;br&gt;
Before any play begins, we must reset the current plate's score. This ensures that runs from the previous batter don't bleed into the current one. It's a temporary "basket" for the current hit's results.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Handling Home Runs with "Excel Logic"&lt;br&gt;
Python&lt;br&gt;
if advance == 4:&lt;br&gt;
scored = sum(self.bases) + 1&lt;br&gt;
I applied my knowledge of Excel's SUM function here. We treat True as 1 and False as 0. By summing the bases and adding 1 (the batter), we get the total runs instantly. Simple and elegant!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The "Anti-Collision" Reverse Loop&lt;br&gt;
Python&lt;br&gt;
for i in range(2, -1, -1): # Checking 3rd -&amp;gt; 2nd -&amp;gt; 1st base&lt;br&gt;
This is the most critical part. To prevent "runner collision" (where a runner moves twice in one turn), we must process the bases from 3rd to 1st. By clearing the path ahead, each runner moves exactly as they should.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Logic of Movement (True vs False)&lt;br&gt;
Scoring: If i + advance &amp;gt;= 3, the runner leaves the field (becomes False) and enters the score sheet (scored += 1).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Advancing: If they stay on the field, we plant a new flag (True) at their new position.&lt;/p&gt;

&lt;p&gt;Cleanup: Regardless of where they go, the original base must be cleared (False).&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
I started the day feeling overwhelmed by the complexity, but by slowing down and translating the code into my own words, I turned stress into a "1% incremental growth."&lt;/p&gt;

&lt;p&gt;PS: I've added detailed comments in the code to explain the base-running logic after a hit.&lt;/p&gt;

</description>
      <category>python</category>
      <category>learning</category>
      <category>gamedev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Small Wins Matter: Refining Steal Logic with Success and Attempt Probabilities</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Wed, 18 Mar 2026 04:09:53 +0000</pubDate>
      <link>https://forem.com/lee12/small-wins-matter-refining-steal-logic-with-success-and-attempt-probabilities-20bj</link>
      <guid>https://forem.com/lee12/small-wins-matter-refining-steal-logic-with-success-and-attempt-probabilities-20bj</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com/4c33a6c0d12b61dbb315ae7eacb7b650.git" rel="noopener noreferrer"&gt;https://gist.github.com/4c33a6c0d12b61dbb315ae7eacb7b650.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following up on my previous post, I’ve just completed an update that adds separate probabilities for both steal attempts and steal success. Even though it hasn't been long since my last update, my passion for achieving these "small wins" kept me moving forward. I want to express my sincere gratitude to everyone who reads my posts and to all my followers.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>gamedev</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Building a Better Baseball Sim: Testing Logic with Manual and Probabilistic Inputs</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Wed, 18 Mar 2026 03:22:30 +0000</pubDate>
      <link>https://forem.com/lee12/building-a-better-baseball-sim-testing-logic-with-manual-and-probabilistic-inputs-18l7</link>
      <guid>https://forem.com/lee12/building-a-better-baseball-sim-testing-logic-with-manual-and-probabilistic-inputs-18l7</guid>
      <description>&lt;p&gt;&lt;a href="https://gist.github.com/ad07af01cbbe20b787a50104393a9570.git" rel="noopener noreferrer"&gt;https://gist.github.com/ad07af01cbbe20b787a50104393a9570.git&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gist.github.com/d57f4cdbef10252d343575bb177590c5.git" rel="noopener noreferrer"&gt;https://gist.github.com/d57f4cdbef10252d343575bb177590c5.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Until now, I had been writing my baseball simulation code by simply accepting whatever the AI provided without proper verification. This led to several logical inconsistencies in the code. To truly learn and master the fundamentals, I’ve decided to start over. I am now manually inputting base-running, stealing, and batting scenarios to observe how the runners move and to solidify my understanding of the basics.&lt;/p&gt;

&lt;p&gt;I have prepared two test files for this purpose:&lt;/p&gt;

&lt;p&gt;The first file allows for manual input of all scenarios, including hits, walks, and steals.&lt;/p&gt;

&lt;p&gt;The second file generates hits and walks based on probability, while still allowing for manual steal attempts.&lt;/p&gt;

&lt;p&gt;I plan to continue testing by adding more features bit by bit. See you in the next update!&lt;/p&gt;

</description>
      <category>python</category>
      <category>baseballdev</category>
      <category>beginners</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Bug that eluded me last time</title>
      <dc:creator>sm.lee</dc:creator>
      <pubDate>Tue, 17 Mar 2026 02:32:39 +0000</pubDate>
      <link>https://forem.com/lee12/bug-that-eluded-me-last-time-3kdd</link>
      <guid>https://forem.com/lee12/bug-that-eluded-me-last-time-3kdd</guid>
      <description>&lt;p&gt;Revised material by Gemini&lt;br&gt;
&lt;a href="https://gist.github.com/6298723571a21eed258913513c70dd02.git" rel="noopener noreferrer"&gt;https://gist.github.com/6298723571a21eed258913513c70dd02.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fixed and Updated Version&lt;br&gt;
&lt;a href="https://gist.github.com/8ea0e1f2b7759971f5b7b116bcd69ed6.git" rel="noopener noreferrer"&gt;https://gist.github.com/8ea0e1f2b7759971f5b7b116bcd69ed6.git&lt;/a&gt;&lt;br&gt;
simulation&lt;br&gt;
&lt;a href="https://gist.github.com/8f8ab58e57631f458fee95403b613dac.git" rel="noopener noreferrer"&gt;https://gist.github.com/8f8ab58e57631f458fee95403b613dac.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Felb6zbicz5lqotrooovb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Felb6zbicz5lqotrooovb.png" alt=" " width="361" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pmj1njs4gxfkk15fbaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pmj1njs4gxfkk15fbaf.png" alt=" " width="361" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm back with a new post, having finally found and fixed the bug that eluded me last time. I felt it was a missed opportunity to immediately clear the bases after the 3rd out. To enhance the excitement of the baseball simulation, I worked hard to preserve the base-running situation from the 2-out mark, displaying it just before the side change even when the 3rd out occurs.&lt;/p&gt;

&lt;p&gt;I plan to keep challenging myself and will continue posting, whether I fail or succeed. I want to express my deepest gratitude to all my followers and everyone who reads my posts.&lt;/p&gt;

&lt;p&gt;PS: To get started, save the Engine and Simulation codes as separate Python files within the same folder. In the Simulation code, update the from statement at the top to match your Engine file's name, then run the Simulation file. It should work perfect&lt;/p&gt;

</description>
      <category>python</category>
      <category>baseballdev</category>
      <category>gamedev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
