<?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>DEV Community: Nicholas</title>
    <description>The latest articles on DEV Community by Nicholas (@eren_poger).</description>
    <link>https://dev.to/eren_poger</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3993828%2Fc19a7c67-2e75-4dc0-85ea-b43cde21a54e.jpg</url>
      <title>DEV Community: Nicholas</title>
      <link>https://dev.to/eren_poger</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eren_poger"/>
    <language>en</language>
    <item>
      <title>Ended Bitboard engine, what's next?</title>
      <dc:creator>Nicholas</dc:creator>
      <pubDate>Tue, 30 Jun 2026 21:16:27 +0000</pubDate>
      <link>https://dev.to/eren_poger/ended-bitboard-engine-whats-next-3dmp</link>
      <guid>https://dev.to/eren_poger/ended-bitboard-engine-whats-next-3dmp</guid>
      <description>&lt;h2&gt;
  
  
  Hey guys ;)
&lt;/h2&gt;

&lt;p&gt;Today I finally finished my bitboard engine! Let me take you through its architecture, and then we'll explore the next steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Core Architecture
&lt;/h3&gt;

&lt;p&gt;All the engine logic lives in &lt;code&gt;bitboard_engine.py&lt;/code&gt;, which contains the &lt;code&gt;Move&lt;/code&gt; and &lt;code&gt;BitboardEngine&lt;/code&gt; classes. However, for everything to sync up, we rely on a few other modules: &lt;code&gt;board.py&lt;/code&gt; (with the &lt;code&gt;Board&lt;/code&gt; class), &lt;code&gt;move_gen.py&lt;/code&gt; (with &lt;code&gt;AttackTables&lt;/code&gt;), and &lt;code&gt;bitboard_utils.py&lt;/code&gt; (housing &lt;code&gt;BitboardConstants&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Here is a breakdown of what each component does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BitboardConstants:&lt;/strong&gt; Contains static methods for fundamental bitwise operations like setting, popping, or getting a bit (&lt;code&gt;set_bit&lt;/code&gt;, &lt;code&gt;pop_bit&lt;/code&gt;, &lt;code&gt;get_bit&lt;/code&gt;), along with constant masks for the board edges (like the A/H files or ranks 1/8).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Board:&lt;/strong&gt; Implements the state of all pieces on the board, handles the initial setup, and tracks tracking piece movements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AttackTables:&lt;/strong&gt; Pre-computes static attack tables for knights and kings, and builds sliding attack tables for rooks, bishops, and queens using &lt;strong&gt;magic numbers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move:&lt;/strong&gt; Describes individual moves, storing data like &lt;code&gt;piece_moved&lt;/code&gt;, &lt;code&gt;piece_captured&lt;/code&gt;, and flags for special moves (&lt;code&gt;is_enpassant&lt;/code&gt;, &lt;code&gt;is_castling&lt;/code&gt;, &lt;code&gt;is_promotion&lt;/code&gt;). It also handles dictionaries for correct chess notation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Heart of the Engine
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;BitboardEngine&lt;/code&gt; is where all these components unite. The core functionality is split into two types of functions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Move Generation:&lt;/strong&gt; The &lt;code&gt;get_valid_moves&lt;/code&gt; function generates legal moves using complex bitwise masking (check masks, pin masks, enemy attack masks, and edge masks). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State Management:&lt;/strong&gt; Functions responsible for tracking the game state (like checkmate or draws) and preparing data for the future RL model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Honestly, this was one of the hardest parts of the project due to the sheer amount of math and theory involved, but the performance payoff compared to the matrix engine will be massive.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's Next?
&lt;/h3&gt;

&lt;p&gt;Next, I’m going to write two "bridge" functions to map bitboard indices back to the matrix format for the UI. After that, it’s time for rigorous testing. To be honest, I won't rest easy until I test it thoroughly—especially regarding special moves and check detection states. &lt;br&gt;
Once the tests pass, the Reinforcement Learning phase officially begins! &lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading! If you have any questions or suggestions about magic numbers or bitboard optimization, let's chat in the comments below!&lt;/em&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9a9729ikmd1hjuj83vjr.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9a9729ikmd1hjuj83vjr.png" alt=" " width="800" height="483"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhgzg3jakw9am30752wmt.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhgzg3jakw9am30752wmt.png" alt=" " width="800" height="428"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffigok5lxouajv8e2avvp.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffigok5lxouajv8e2avvp.png" alt=" " width="799" height="427"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6ymjikv8ve1f39g1qfgy.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6ymjikv8ve1f39g1qfgy.png" alt=" " width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#chess&lt;/code&gt; &lt;code&gt;#bitboards&lt;/code&gt; &lt;code&gt;#showdev&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My first post</title>
      <dc:creator>Nicholas</dc:creator>
      <pubDate>Sat, 27 Jun 2026 19:42:20 +0000</pubDate>
      <link>https://dev.to/eren_poger/my-first-post-4hdl</link>
      <guid>https://dev.to/eren_poger/my-first-post-4hdl</guid>
      <description>&lt;h2&gt;
  
  
  Hey everyone, it’s my first post here ;)
&lt;/h2&gt;

&lt;p&gt;Today I want to show you the project I’m currently working on. It’s &lt;strong&gt;Chess Project X&lt;/strong&gt; (available as &lt;code&gt;chess-project&lt;/code&gt; on GitHub). The development is divided into two main milestones.&lt;/p&gt;

&lt;h3&gt;
  
  
  Milestone 1: The Matrix Engine &amp;amp; UI
&lt;/h3&gt;

&lt;p&gt;The first step was creating a basic chess engine from scratch along with a graphical interface. I built the initial core using matrix logic in pure Python and used the &lt;strong&gt;Pygame&lt;/strong&gt; library for the UI. It includes all the neat features I personally enjoy on Chess.com: analysis arrows, highlighted squares, visual move hints, and even the native sound effects. &lt;br&gt;
For the AI at this stage, I implemented a classic &lt;strong&gt;Minimax algorithm with Alpha-Beta pruning&lt;/strong&gt; running at a maximum depth of 4.&lt;br&gt;
Check video of gameplay on X:&lt;br&gt;
&lt;iframe class="tweet-embed" id="tweet-2046898283264495656-673" src="https://platform.twitter.com/embed/Tweet.html?id=2046898283264495656"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2046898283264495656-673');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2046898283264495656&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;h3&gt;
  
  
  Milestone 2: Transitioning to Bitboards &amp;amp; RL
&lt;/h3&gt;

&lt;p&gt;The ultimate goal is to implement a Reinforcement Learning (RL) agent. Doing this on top of a matrix-based engine would be heavily bottlenecked by performance, so I decided to rewrite the entire engine using &lt;strong&gt;bitboards&lt;/strong&gt;. &lt;br&gt;
&lt;strong&gt;Current state of the rewrite:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implemented a new &lt;code&gt;Board&lt;/code&gt; class.&lt;/li&gt;
&lt;li&gt;Wrote basic bitwise utility functions (&lt;code&gt;set_bit&lt;/code&gt;, &lt;code&gt;get_bit&lt;/code&gt;, &lt;code&gt;pop_bit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Generated pre-computed attack masks for every piece type.
For the last two days, I’ve been heavily focused on the move validation logic. There are two ways to find legal moves:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Matrix Way:&lt;/strong&gt; Execute &lt;code&gt;make_move&lt;/code&gt;, check if the king is under attack, and then &lt;code&gt;undo_move&lt;/code&gt;. It's easy to code but much slower.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Bitboard Way:&lt;/strong&gt; Generate all possible pin and check masks via bitwise operations. It's significantly harder to implement, but the performance payoff is massive.
Right now, I've finished the logic for the king and knights. Next up: rooks, bishops, queens, and pawns. Once done, I’ll hook it up to the Pygame UI, run tests, and finally start training the RL model!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;I hope you found this breakdown interesting! If you have any questions, tech suggestions, or ideas about bitboards, feel free to drop them in the comments below. See you in the next update!&lt;/em&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwhk9ocppmvlg6tric6wg.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwhk9ocppmvlg6tric6wg.png" alt=" " width="800" height="205"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6s5b9fhmwp0aexldfxc7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6s5b9fhmwp0aexldfxc7.png" alt=" " width="800" height="428"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F881m8pnf1z6qxre1yrxe.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F881m8pnf1z6qxre1yrxe.png" alt=" " width="799" height="427"&gt;&lt;/a&gt;&lt;br&gt;
&lt;code&gt;#python&lt;/code&gt; &lt;code&gt;#chess&lt;/code&gt; &lt;code&gt;#reinforcementlearning&lt;/code&gt; &lt;code&gt;#bitboards&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
