<?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: Фёдор Поцелуев</title>
    <description>The latest articles on Forem by Фёдор Поцелуев (@__6e8fa9e6d9).</description>
    <link>https://forem.com/__6e8fa9e6d9</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%2F2125200%2Fa21c900d-5cdc-4002-897f-1ed4c8cd80c1.jpg</url>
      <title>Forem: Фёдор Поцелуев</title>
      <link>https://forem.com/__6e8fa9e6d9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/__6e8fa9e6d9"/>
    <language>en</language>
    <item>
      <title>Tetris Game Development – Seeking Coding Advice and Feedback</title>
      <dc:creator>Фёдор Поцелуев</dc:creator>
      <pubDate>Wed, 25 Sep 2024 14:01:37 +0000</pubDate>
      <link>https://forem.com/__6e8fa9e6d9/tetris-game-development-seeking-coding-advice-and-feedback-41l2</link>
      <guid>https://forem.com/__6e8fa9e6d9/tetris-game-development-seeking-coding-advice-and-feedback-41l2</guid>
      <description>&lt;p&gt;Hey everyone!&lt;/p&gt;

&lt;p&gt;I’ve recently completed a Tetris game and am currently focusing on refining some parts of the code. I would be grateful for any general coding advice and feedback on how to improve the structure and readability of my code.&lt;/p&gt;

&lt;p&gt;In particular, I’ve been concerned about these specific areas:&lt;/p&gt;

&lt;p&gt;Functions in the &lt;code&gt;conflict_resolution.c&lt;/code&gt; module:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The functions &lt;code&gt;side_cells_crossing_prevention&lt;/code&gt;, &lt;code&gt;side_boundaries_crossing_&lt;/code&gt;, &lt;code&gt;bottom_top_boundaries_crossing_&lt;/code&gt; of the &lt;code&gt;conflict_resolution.c&lt;/code&gt; module don't seem to be clean and easy to read code. They used to be a single function. Is there a better way to structure these functions for clarity and maintainability?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Duplicated logic in the &lt;code&gt;conflict_resolution.c&lt;/code&gt; module:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;conflict_resolution.c&lt;/code&gt; module has the functions &lt;code&gt;top_center_conflict&lt;/code&gt;, &lt;code&gt;top_right_corner_conflict&lt;/code&gt;, &lt;code&gt;right_center_conflict&lt;/code&gt;, &lt;code&gt;bottom_right_corner_conflict&lt;/code&gt;, &lt;code&gt;bottom_center_conflict&lt;/code&gt;, &lt;code&gt;bottom_left_corner_conflict&lt;/code&gt;, &lt;code&gt;left_center_conflict&lt;/code&gt; and &lt;code&gt;top_left_corner_conflict&lt;/code&gt; that seem to have quite a bit of duplicated logic. Additionally, the &lt;code&gt;handle_top_center_conflict&lt;/code&gt;, &lt;code&gt;handle_right_center_conflict&lt;/code&gt;, &lt;code&gt;handle_bottom_center_conflict&lt;/code&gt;, &lt;code&gt;handle_left_center_conflict&lt;/code&gt; functions could probably be refactored to reduce repetition.
Any advice on how to better consolidate these would be really appreciated!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the link to the full code: &lt;a href="https://github.com/FyodorPotseluev/tetris" rel="noopener noreferrer"&gt;https://github.com/FyodorPotseluev/tetris&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You're welcome to join the "Discussions" section of the repository.&lt;/p&gt;

&lt;p&gt;Any thoughts or suggestions would be super helpful! &lt;/p&gt;

</description>
      <category>c</category>
      <category>refactorit</category>
      <category>help</category>
    </item>
  </channel>
</rss>
