<?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: Nabir14</title>
    <description>The latest articles on DEV Community by Nabir14 (@nabir14).</description>
    <link>https://dev.to/nabir14</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%2F2109890%2Fcd9ce5cd-5f3c-4248-9a98-14c011d981fa.png</url>
      <title>DEV Community: Nabir14</title>
      <link>https://dev.to/nabir14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nabir14"/>
    <language>en</language>
    <item>
      <title>Drawing On DOS</title>
      <dc:creator>Nabir14</dc:creator>
      <pubDate>Thu, 05 Mar 2026 13:42:31 +0000</pubDate>
      <link>https://dev.to/nabir14/drawing-on-dos-59cf</link>
      <guid>https://dev.to/nabir14/drawing-on-dos-59cf</guid>
      <description>&lt;p&gt;I always found retro games very interesting. Since I grew up playing browser games and most of them were emulated I think it played a big role in defining this interest in me.&lt;/p&gt;

&lt;p&gt;Anyways, So among all the other platforms &lt;strong&gt;DOS (Disk Based Operating System)&lt;/strong&gt; is one of my favorite. I have recently installed FreeDOS and plan to program on it as hobby.&lt;/p&gt;

&lt;p&gt;Today, I will explain how you can draw pixels on screen using C as the programming language, FreeDOS as the operating system and Doing by directly writing to VGA (Video Graphics Array).&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Info About VGA
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;VGA (Video Graphics Array)&lt;/strong&gt; is a video display controller that was first introduced in IBM PS/2 line computers.&lt;/p&gt;

&lt;p&gt;Generally,&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;3h&lt;/code&gt; mode also known as &lt;strong&gt;Text Mode&lt;/strong&gt; can be used to print text and is used in Terminal and CLI applications/games to display text.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;13h&lt;/code&gt; mode also known as &lt;strong&gt;Graphics Mode&lt;/strong&gt; can be used to plot pixels, draw shapes and images on screen. It is used by 2D/3D games.&lt;/p&gt;

&lt;p&gt;This blog post will mostly focus on VGA mode &lt;code&gt;13h&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drawing A Single Pixel
&lt;/h2&gt;

&lt;p&gt;To draw a single pixel we will first create a new C source file &lt;code&gt;pixel.c&lt;/code&gt; (you can name it whatever you want).&lt;/p&gt;

&lt;p&gt;Before we can draw anything we need to switch our video mode from &lt;strong&gt;Text Mode&lt;/strong&gt; to &lt;strong&gt;Graphics Mode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We do the following:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;dos.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bios.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Define a REGS union&lt;/span&gt;
    &lt;span class="k"&gt;union&lt;/span&gt; &lt;span class="n"&gt;REGS&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Set AH to 0x0 because we want to set video mode&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x13&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Set AL to 0x13 because we want Graphics Mode&lt;/span&gt;
    &lt;span class="n"&gt;int86&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Call Intrrupt 10h&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we first include two headers &lt;code&gt;dos.h&lt;/code&gt; and &lt;code&gt;bios.h&lt;/code&gt;. These are needed to get the &lt;code&gt;REGS&lt;/code&gt; union and &lt;code&gt;int86()&lt;/code&gt; function. You can also inline assembly but I choose to code this way.&lt;/p&gt;

&lt;p&gt;Now we are in &lt;strong&gt;Graphics Mode&lt;/strong&gt;. We can now draw pixel on screen of a specific color.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We can do it like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;dos.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bios.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;union&lt;/span&gt; &lt;span class="n"&gt;REGS&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;far&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;vga&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;far&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="mh"&gt;0xA0000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x0C&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x13&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;int86&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;vga&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Set pixel at offset with a specific color&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we first declare a pointer that stores the VGA address. This address is &lt;code&gt;0xB000&lt;/code&gt; for &lt;strong&gt;Text Mode&lt;/strong&gt; and &lt;code&gt;0xA000&lt;/code&gt; for &lt;strong&gt;Graphics Mode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For DOS we need to declare it as a far pointer and asign memory address 0xA0000000. (if we wanted &lt;strong&gt;Text Mode&lt;/strong&gt; it would be &lt;code&gt;0xB0000000&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;We also declare an offset variable since the VGA buffer is a 1D array unlike computer screens that are 2D. We can calculate offset from x and y by doing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;offset = y * MAX_WIDTH + x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In VGA 13h mode screen resolution can range from 320x200 to 640x480. So I did:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;offset = y * 320 + x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also declared a color variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Below is the VGA pallette with HEX code:&lt;/strong&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%2F8he24esb3mjr8wxkux2u.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%2F8he24esb3mjr8wxkux2u.png" alt="vgaColors" width="518" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This means that we want to draw a pixel with a Bright Red color.&lt;/p&gt;

&lt;p&gt;If we now compile the code as is there would be a bright red pixel drawn on screen.&lt;/p&gt;

&lt;p&gt;I am using the OpenWatcom compiler to compile my code for FreeDOS.&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%2Fbfxsvar4l9n54f9l8fwi.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%2Fbfxsvar4l9n54f9l8fwi.png" alt="singlePixel" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What's that? You can't switch back to your Terminal?? :(&lt;br&gt;
Don't worry you can switch back to Text Mode before terminating the program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We can do this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;dos.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bios.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;conio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;union&lt;/span&gt; &lt;span class="n"&gt;REGS&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;far&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;vga&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;far&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="mh"&gt;0xA0000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x0C&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x13&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;int86&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;vga&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Wait for an input&lt;/span&gt;
    &lt;span class="n"&gt;getch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Switch back to Text Mode and terminate&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x03&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;int86&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we use &lt;code&gt;getch()&lt;/code&gt; provided by &lt;code&gt;conio.h&lt;/code&gt; to read for an input. So if any key is pressed we immediately switch back to VGA 3h Text Mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filling The Entire Screen With Random Colored Pixels
&lt;/h2&gt;

&lt;p&gt;With the knowledge of how to draw a single pixel we can now do a for loop and loop over the entire screen filling it with random colors!&lt;/p&gt;

&lt;p&gt;We do that like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;dos.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;bios.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;conio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;time.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;random_range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;union&lt;/span&gt; &lt;span class="n"&gt;REGS&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;far&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;vga&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;far&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="mh"&gt;0xA0000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Seed rand() with time &lt;/span&gt;
    &lt;span class="n"&gt;srand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x13&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;int86&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;vga&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random_range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x0F&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Assign a random color ranging from 0x0 to 0x0F&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;getch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ah&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;al&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x03&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;int86&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we define a new function &lt;code&gt;random_range&lt;/code&gt; for generating random integer values in a set range.&lt;/p&gt;

&lt;p&gt;We first seed &lt;code&gt;rand()&lt;/code&gt; using time provided by &lt;code&gt;time.h&lt;/code&gt;. Then we do two for loops one for x and one for y.&lt;/p&gt;

&lt;p&gt;This will start form (0, 0) and end at (320, 200) which is our screen resolution.&lt;/p&gt;

&lt;p&gt;Then we calculate the offset and set the current pixel with a random color ranging from 0x0 to 0x0F.&lt;/p&gt;

&lt;p&gt;Compiling and running the code gives us a screen filled with random colored pixels.&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%2Faqpvmtvytob4h4z0sd7q.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%2Faqpvmtvytob4h4z0sd7q.png" alt="randomPixel" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That's it! Now you can create cool games or graphical applications for DOS :D&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I also posted this blog on my newly created personal website: &lt;a href="https://nabir14.github.io/website" rel="noopener noreferrer"&gt;https://nabir14.github.io/website&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>learning</category>
      <category>gamedev</category>
      <category>dos</category>
    </item>
    <item>
      <title>AI Vibe Coding Is A Lie</title>
      <dc:creator>Nabir14</dc:creator>
      <pubDate>Sun, 30 Nov 2025 14:05:04 +0000</pubDate>
      <link>https://dev.to/nabir14/ai-vibe-coding-is-a-lie-23e4</link>
      <guid>https://dev.to/nabir14/ai-vibe-coding-is-a-lie-23e4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hello 👋,&lt;br&gt;
I am a self-taught programmer. I mostly do Game Development and Web Development. I have also worked on some Low Level Projects.&lt;/p&gt;

&lt;p&gt;In this article I will present my opinions on Vibe Coding.&lt;/p&gt;

&lt;p&gt;In the last 2 years the term "AI Vibe Coding" has been very hyped. I mean the idea of "Clicking a button and generating anything you can imagine" is very exciting at first but not a great idea at the same time.&lt;/p&gt;

&lt;p&gt;I will give my opinion on why it isn't a good idea to depend on AI Vibe Coding tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  How AI Tools Work
&lt;/h2&gt;

&lt;p&gt;Let's first talk about how basically these Vibe Coding AI Models work.&lt;/p&gt;

&lt;p&gt;AI LLMs are trained on data and are trained to predict output from user input (prompt) based on that data.&lt;br&gt;
The whole functionality of those AI Models depend on the data they are trained on.&lt;/p&gt;

&lt;p&gt;Which means AI Models that can code is trained on existing human written code and AI Models that can draw is trained on existing human drawn art. This means that AI can't create something entirely unique that has never been created by humans without the help of humans.&lt;/p&gt;

&lt;h2&gt;
  
  
  Present
&lt;/h2&gt;

&lt;p&gt;Currently many people are trying to establish tools that can "Create anything you can imagine with only a click of a button" and people are also trying to make Game Development a thing for "everyone".&lt;/p&gt;

&lt;p&gt;But are failing to do so.&lt;/p&gt;

&lt;p&gt;Instead we are seeing slop games that aren't even actually fun to play from a gamers perspective.&lt;/p&gt;

&lt;p&gt;Many web apps made with AI have broken features and are most likely a clone of an existing solution with less quality and more security vulnerabilities.&lt;/p&gt;

&lt;p&gt;Instead of being helpful they are just cash grabs and some are even scams! That other people are falling for.&lt;/p&gt;

&lt;p&gt;It should be understood that with current AI Models it is impossible to create something with one click that is fully secure, has unique features and has literally no bugs.&lt;/p&gt;

&lt;p&gt;Now to fix these bugs you need programming knowledge and a lot of time to debug.&lt;/p&gt;

&lt;p&gt;In that way you would be better creating the game or coding the website on your own. Atleast you will have the full idea of the thing you are working on.&lt;/p&gt;

&lt;p&gt;If people continue with Vibe Coding trying to replace actual developers. One day the internet will be filled with more garbage content than actual useful content.&lt;br&gt;
Then probably we would need to come up with a solution to entirely filter these garbage?&lt;/p&gt;

&lt;h2&gt;
  
  
  Future (My Prediction)
&lt;/h2&gt;

&lt;p&gt;Now let's imagine for a moment that there's a new AI Model that can create anything you want by just telling it what to generate and it generates it without any errors at all in one click.&lt;/p&gt;

&lt;p&gt;This sounds very good right!? No need to buy subscriptions for an app when you can generate it yourself in one click without any knowledge of how it works under the hood!&lt;/p&gt;

&lt;p&gt;Well Exactly, That is the problem.&lt;/p&gt;

&lt;p&gt;In this way there won't be any consumers. Because why would someone use your app if they can generate something like it themselves?&lt;/p&gt;

&lt;p&gt;Oh then maybe making or training AI Models will be the only thing in programming?&lt;/p&gt;

&lt;p&gt;No, In this case anyone can build their own AI better than yours.&lt;/p&gt;

&lt;p&gt;Basically, In this way nobody will buy software because they can create it themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The idea "Coding For Everyone" is like "Giving A Cat To Every Human On Earth". It sounds cute but not everyone needs a cat (some people can't even take care of one!) and just like that not everyone needs to code.&lt;/p&gt;

&lt;p&gt;A person who really wants to code will not depend on something that prevents them from coding.&lt;/p&gt;

&lt;p&gt;Instead they will learn how to code and use AI Models just as a tool to help them on their journey. They might use AI Models as a mentor, As a debugger or As a code reviewer etc.&lt;/p&gt;

&lt;p&gt;Just like a cat for a person who doesn't know how to take care of it is dangerous. AI Coding Tools for a person who doesn't understand basic programming is also dangerous.&lt;/p&gt;

&lt;p&gt;In that case we are just wasting our useful resources on AI Vibe Coding that we could instead use for something else.&lt;/p&gt;

&lt;p&gt;Infact In My Opinion, People who think that without understanding actual programming and depending on AI Vibe Coding tools is making them productive are actually wasting their time.&lt;/p&gt;

&lt;p&gt;We can only expect absolute slop and vulnerable apps from vibe coding.&lt;/p&gt;

&lt;p&gt;Yes it will save time and bring some money but when people get sick of AI Slop that saved time and money will be spent to find an alternative earning source.&lt;/p&gt;

&lt;p&gt;Yes it will keep improving but improving it just to replace humans might not be a great idea.&lt;/p&gt;

&lt;p&gt;Would you want the internet to be filled with copy paste clones of the same apps and games but with less quality and soul?&lt;/p&gt;

&lt;p&gt;Let me know about your thoughts on AI Vibe Coding.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>webdev</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Make Games On Phone</title>
      <dc:creator>Nabir14</dc:creator>
      <pubDate>Thu, 31 Jul 2025 08:53:49 +0000</pubDate>
      <link>https://dev.to/nabir14/make-games-on-phone-3nm6</link>
      <guid>https://dev.to/nabir14/make-games-on-phone-3nm6</guid>
      <description>&lt;p&gt;Hello 👋, I am an indie game developer and I have been making games using my phone as I don't have any PC or Laptop. I learned programming, gamedev, pixel art and etc on my phone. &lt;br&gt;
So today I am writing for those who are interested in making games on phone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE that it's generally not recommended to make games on phone.&lt;/strong&gt; As even on high-end computers it's just too much work to do. Only make games on phone if you don't have any other options or you're very interested in it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Make Games
&lt;/h2&gt;

&lt;p&gt;To make games you would generally use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frameworks:&lt;/strong&gt; If coding the game from scratch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Game Engines:&lt;/strong&gt; If not coding from scratch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asset Stores:&lt;/strong&gt; If using premade assets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asset Creation Tools:&lt;/strong&gt; If you want to make assets yourself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Frameworks like &lt;a href="https://www.libsdl.org/" rel="noopener noreferrer"&gt;SDL&lt;/a&gt;, &lt;a href="https://www.raylib.com/" rel="noopener noreferrer"&gt;RayLib&lt;/a&gt; and &lt;a href="https://love2d.org/" rel="noopener noreferrer"&gt;LÖVE&lt;/a&gt; is mostly chosen to make games from scratch and Game engines like &lt;a href="https://unity.com/" rel="noopener noreferrer"&gt;Unity&lt;/a&gt;, &lt;a href="https://godotengine.org/" rel="noopener noreferrer"&gt;Godot&lt;/a&gt; and &lt;a href="https://www.unrealengine.com/en-US" rel="noopener noreferrer"&gt;Unreal&lt;/a&gt; is commonly used for making games. For assets &lt;a href="https://sketchfab.com/" rel="noopener noreferrer"&gt;Sketchfab&lt;/a&gt; is a great place for 3D assets and &lt;a href="https://itch.io/" rel="noopener noreferrer"&gt;Itch.io&lt;/a&gt; also has premade assets. &lt;a href="https://www.blender.org/" rel="noopener noreferrer"&gt;Blender&lt;/a&gt; is very commonly used to make 3d assets and &lt;a href="https://www.aseprite.org/" rel="noopener noreferrer"&gt;Asprite&lt;/a&gt; for pixel art assets.&lt;/p&gt;

&lt;p&gt;Though when making games on phone your choices are limited... &lt;strong&gt;Or Is It?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Make Games (on phone):
&lt;/h2&gt;

&lt;p&gt;When making games or even coding you need a "Development Environment". On phone you can use &lt;a href="https://termux.dev/en/" rel="noopener noreferrer"&gt;Termux&lt;/a&gt; which is a terminal emulator and gives you a Linux Environment. If you have a decent phone (e.g 4GB ram, Android 11 and Adreno 610) you can run Linux apps like Blender (hardware acceleration required), &lt;a href="https://www.gimp.org/" rel="noopener noreferrer"&gt;Gimp&lt;/a&gt;, &lt;a href="https://www.mapeditor.org/" rel="noopener noreferrer"&gt;Tiled&lt;/a&gt; etc. You also get to run IDEs like &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt; on it with frameworks. For Game Engines you can use Godot which is available natively on Android or use it with Termux to bypass some limitations with the Godot Android Editor.&lt;/p&gt;

&lt;p&gt;I have discussed these in more details in my latest video.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;👇 Check it out if you're interested in Gamedev On Android 👇&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://youtu.be/Htdui-cR2Mg" rel="noopener noreferrer"&gt;https://youtu.be/Htdui-cR2Mg&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>programming</category>
      <category>android</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Cross-Compiling GCC in Linux</title>
      <dc:creator>Nabir14</dc:creator>
      <pubDate>Sat, 02 Nov 2024 08:05:32 +0000</pubDate>
      <link>https://dev.to/nabir14/cross-compiling-gcc-in-linux-4peo</link>
      <guid>https://dev.to/nabir14/cross-compiling-gcc-in-linux-4peo</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest"&gt;2024 Hacktoberfest Writing challenge&lt;/a&gt;: Maintainer Experience&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this article I will help you cross compile gcc in your Linux system. You need a cross-compiled GCC to compile code for multiple platforms from a single development host. I needed this to make my own Operating System from scratch. Dosen't matter what projects your cross compiling for the process is almost same. A note that this article only focuses in cross compiling on Linux systems. If you are on other systems like MacOS the process might be different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required Packages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;build-essential&lt;/li&gt;
&lt;li&gt;bison&lt;/li&gt;
&lt;li&gt;flex&lt;/li&gt;
&lt;li&gt;libgmp3-dev&lt;/li&gt;
&lt;li&gt;libmpc-dev&lt;/li&gt;
&lt;li&gt;libmpfr-dev&lt;/li&gt;
&lt;li&gt;texinfo&lt;/li&gt;
&lt;li&gt;libisl-dev&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install these by typing &lt;code&gt;sudo apt install &amp;lt;package-name&amp;gt;&lt;/code&gt; if you use Ubuntu/Debian, &lt;code&gt;sudo dnf install &amp;lt;package-name&lt;/code&gt; if you use Fedora or &lt;code&gt;sudo pacman -Syu &amp;lt;package-name&amp;gt;&lt;/code&gt; if you use Arch Linux. This depends on your distro.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-Compiling Process:&lt;/strong&gt;&lt;br&gt;
First you have to set some global variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/bin/gcc 
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/bin/gcc 
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PREFIX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/usr/local/i386elfgcc"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TARGET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;i386-elf
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PREFIX&lt;/span&gt;&lt;span class="s2"&gt;/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can get the path of your &lt;code&gt;gcc&lt;/code&gt; using &lt;code&gt;which gcc&lt;/code&gt;. Then you can set it for CC and LD. PREFIX is where you want your cross-compiled files to be saved in. Target is your target architecture which is the architecture your cross-compiling for. I used x86 (i386) as an example.&lt;/p&gt;

&lt;p&gt;Now you have to make a temporary directory to save your downloaded files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; /tmp/src 
&lt;span class="nb"&gt;cd&lt;/span&gt; /tmp/src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make the directory and CD into it.&lt;/p&gt;

&lt;p&gt;Now, Finally you can start compiling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://ftp.gnu.org/gnu/binutils/binutils-version.tar.gz 
&lt;span class="nb"&gt;tar &lt;/span&gt;xf binutils-version.tar.gz
&lt;span class="nb"&gt;mkdir &lt;/span&gt;binutils-build
&lt;span class="nb"&gt;cd &lt;/span&gt;binutils-build
../binutils-version/configure &lt;span class="nt"&gt;--target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt; &lt;span class="nt"&gt;--enable-interwork&lt;/span&gt; &lt;span class="nt"&gt;--enable-multilib&lt;/span&gt; &lt;span class="nt"&gt;--disable-nls&lt;/span&gt; &lt;span class="nt"&gt;--disable-werror&lt;/span&gt; &lt;span class="nt"&gt;--prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PREFIX&lt;/span&gt; 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tee &lt;/span&gt;configure.log
make all &lt;span class="nb"&gt;install &lt;/span&gt;2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;tee &lt;/span&gt;make.log

&lt;span class="nb"&gt;cd&lt;/span&gt; /tmp/src
curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://ftp.gnu.org/gnu/gcc/gcc-version/gcc-version.tar.gz 
&lt;span class="nb"&gt;tar &lt;/span&gt;xf gcc-version.tar.gz 
&lt;span class="nb"&gt;mkdir &lt;/span&gt;gcc-build
&lt;span class="nb"&gt;cd &lt;/span&gt;gcc-build
../gcc-version/configure &lt;span class="nt"&gt;--target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt; &lt;span class="nt"&gt;--prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PREFIX&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--disable-nls&lt;/span&gt; &lt;span class="nt"&gt;--disable-libssp&lt;/span&gt; &lt;span class="nt"&gt;--enable-languages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;c &lt;span class="nt"&gt;--without-headers&lt;/span&gt;
make all-gcc 
make all-target-libgcc 
make install-gcc
make install-target-libgcc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please replace the &lt;code&gt;version&lt;/code&gt; with your binutils and gcc version. For example &lt;code&gt;binutils-version&lt;/code&gt; might be &lt;code&gt;binutils-2.40&lt;/code&gt; and &lt;code&gt;gcc-version&lt;/code&gt; might be &lt;code&gt;gcc-12.1.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This will take some time to compile so get some coffee ☕ (or do anything to pass the time). Then after it's done you will have the usable binaries in your &lt;code&gt;/usr/local/i386elf/bin/&lt;/code&gt; prefixed as &lt;code&gt;i386-&lt;/code&gt; (or the architecture of your target if you didn't choose i386 as target). For example your cross compiled gcc might be &lt;code&gt;i386-gcc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Congratulations 🎉 you have successfully cross-compiled your GCC.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hello, I am a student and I love programming. If my articles help you and you want to donate then thanks as it will support my education and help me reach my goal!&lt;/em&gt; &lt;a href="https://patreon.com/Nabir14?utm_medium=unknown&amp;amp;utm_source=join_link&amp;amp;utm_campaign=creatorshare_creator&amp;amp;utm_content=copyLink" rel="noopener noreferrer"&gt;Donate Nabir14&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Center HTML div With CSS</title>
      <dc:creator>Nabir14</dc:creator>
      <pubDate>Wed, 30 Oct 2024 13:32:54 +0000</pubDate>
      <link>https://dev.to/nabir14/center-html-div-with-css-1lpj</link>
      <guid>https://dev.to/nabir14/center-html-div-with-css-1lpj</guid>
      <description>&lt;p&gt;It is quite challenging to center divs in HTML especially doing both horizontally and vertically. But in this article I'll help you!&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Example With Explanation:
&lt;/h2&gt;

&lt;p&gt;Let's say there is a &lt;code&gt;div&lt;/code&gt; with class &lt;code&gt;myDiv&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myDiv"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;hello dev&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's,&lt;br&gt;
&lt;strong&gt;Center Horizontally Using CSS:&lt;/strong&gt;&lt;br&gt;
To center this div horizontally we can use this CSS code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.myDiv&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this CSS code &lt;code&gt;padding: 0 100%;&lt;/code&gt; sets the X-axis padding to 100% (full-screen width) to center the div horizontally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Center Vertically Using CSS:&lt;/strong&gt;&lt;br&gt;
To center this div vertically we can use this CSS code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.myDiv&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this CSS code &lt;code&gt;padding: 100% 0;&lt;/code&gt; sets the Y-axis padding to 100% (full-screen height) to center the div vertically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Center Horizontally &amp;amp; Vertically Using CSS:&lt;/strong&gt;&lt;br&gt;
Now let's center it both vertically and horizontally using CSS.&lt;br&gt;
Let's use this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.myDiv&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code &lt;code&gt;display: flex;&lt;/code&gt; sets the display mode to flexbox which is important for this to work. Then &lt;code&gt;justify-content: center;&lt;/code&gt; justifies the content to center and &lt;code&gt;align-items: center;&lt;/code&gt; aligns the items to center. They work together to horizontally centering the div. Finally &lt;code&gt;padding: 100% 0;&lt;/code&gt; adds 100% padding to Y-axis (full-screen height) to center the div vertically like before. Putting all together they center div vertically and horizontally.&lt;/p&gt;

&lt;p&gt;This was all about centering divs using CSS, &lt;a href="https://www.w3schools.com/css/css_align.asp" rel="noopener noreferrer"&gt;Learn More&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using TailwindCSS:&lt;/strong&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%2Ft8yvmy1poipm69x23ust.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%2Ft8yvmy1poipm69x23ust.png" alt="Image description" width="318" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, I can't end this article without telling you to use TailwindCSS. It's my favorite framework as it helped me a lot as a beginner.&lt;/p&gt;

&lt;p&gt;Let's center the div using TailwindCSS,&lt;br&gt;
&lt;strong&gt;Horizontally:&lt;/strong&gt;&lt;br&gt;
Using TailwindCSS to center a div horizontally can be done by using this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"flex items-center"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;hello&lt;/span&gt; &lt;span class="nt"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code the TailwindCSS class &lt;code&gt;flex&lt;/code&gt; sets the display to flexbox and &lt;code&gt;items-center&lt;/code&gt; centers the item horizontally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vertically:&lt;/strong&gt;&lt;br&gt;
Using TailwindCSS to center a div vertically can be done by using this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"h-screen flex items-center"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;hello&lt;/span&gt; &lt;span class="nt"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code the TailwindCSS class &lt;code&gt;h-screen&lt;/code&gt; makes the div using full-screen height, the class &lt;code&gt;flex&lt;/code&gt; sets the display to flexbox and &lt;code&gt;items-center&lt;/code&gt; centers the item.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vertically &amp;amp; Horizontally:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"h-screen flex items-center justify-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;hello dev&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code the class &lt;code&gt;h-screen&lt;/code&gt; makes the div using full-screen height, the class &lt;code&gt;flex&lt;/code&gt; sets the display to flexbox, &lt;code&gt;items-center&lt;/code&gt; centers the item and &lt;code&gt;justify-center&lt;/code&gt; justifies the item to the center. Putting all together centers the div both vertically and horizontally.&lt;/p&gt;

&lt;p&gt;That's all for centering divs using TailwindCSS, &lt;a href="https://hackernoon.com/how-to-centre-an-element-in-css-with-tailwind" rel="noopener noreferrer"&gt;Learn More&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Centering divs can make elements in your website stand out and that's how you center a HTML div.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make sure to practice and not fully depend on memorizing properties. Have A Nice Day :)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hello, I am a student and I love programming. If my articles help you and you want to donate then thanks as it will support my education and help me reach my goal!&lt;/em&gt; &lt;a href="https://patreon.com/Nabir14?utm_medium=unknown&amp;amp;utm_source=join_link&amp;amp;utm_campaign=creatorshare_creator&amp;amp;utm_content=copyLink" rel="noopener noreferrer"&gt;Donate Nabir14&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Learn CSS Properly</title>
      <dc:creator>Nabir14</dc:creator>
      <pubDate>Tue, 29 Oct 2024 16:54:39 +0000</pubDate>
      <link>https://dev.to/nabir14/learn-css-properly-1k4f</link>
      <guid>https://dev.to/nabir14/learn-css-properly-1k4f</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learn CSS Properly&lt;/strong&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%2Fy3a3jhkklte9mckc90ik.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%2Fy3a3jhkklte9mckc90ik.png" alt="Image description" width="284" height="177"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;CSS (Cascading Style Sheets)&lt;/strong&gt;&lt;/em&gt; are used by web developers to style websites.&lt;/p&gt;

&lt;p&gt;When I started learning web development I was very confused about CSS. The most difficulty I had was in both remembering properties and maintaining my code. In this article I will help beginners avoid the mistakes I had made while learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Practice&lt;/strong&gt;&lt;br&gt;
Programming is something you can't fully memorize. It's all about understanding it by practicing.&lt;br&gt;
While I was learning CSS practicing it was a bit hard because I can't memorize things very well. I tried to avoid the "copy &amp;amp; paste" because I thought it would ruin my skills. At the end I did ended copy and pasting CSS code. Now I am not saying that copy and pasting would make things better. But if you try to understand what's happening when you run your copy and pasted CSS code. It will be way better than memorizing CSS properties.&lt;/p&gt;

&lt;p&gt;(For Example) If you wanted to style a button round and black with white text and wanted it swap background and text colors when hover. You could past a block of CSS code that did exactly that like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.myButton&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.myButton&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without understanding what it does it won't help much. &lt;br&gt;
If you understand that: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;border: 2px solid;&lt;/code&gt; added a 2 pixel solid border to the button, &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;border-radius: 16px&lt;/code&gt; made it 16 pixels rounder, &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;background-color: #000000;&lt;/code&gt; made the background black, &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;color: #ffffff;&lt;/code&gt; made the text white, &lt;code&gt;:hover&lt;/code&gt;, &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;background-color: #ffffff;&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;and &lt;code&gt;color: #000000;&lt;/code&gt; makes the background white and the text black when hover.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will be able to code a button next time without needing to copy paste and even better you will have basic understanding of &lt;code&gt;border&lt;/code&gt;, &lt;code&gt;border-radius&lt;/code&gt;, &lt;code&gt;background-color&lt;/code&gt;, &lt;code&gt;color&lt;/code&gt; and &lt;code&gt;:hover&lt;/code&gt; and will be able to use it on more than just a button. This is why you should understand the code that you copy paste.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recourses:&lt;/strong&gt;&lt;br&gt;
Where you are copy and pasting code from also matters. As you will need good explanation of code as a beginner.&lt;/p&gt;

&lt;p&gt;There are a lot of sites that do this job well but I'd recommend:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;1. Geeks For Geeks:&lt;/strong&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%2F2cwx8f2id98asjf5qzcf.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%2F2cwx8f2id98asjf5qzcf.png" alt="Image description" width="225" height="225"&gt;&lt;/a&gt;&lt;br&gt;
GeeksforGeeks is a leading online platform that provides computer science and programming resources to millions of developers and technology enthusiasts worldwide with a vast library of courses, offline classroom programs, tutorials, articles, coding challenges, practice problems, &amp;amp; much more.&lt;/p&gt;

&lt;p&gt;This platform gives code with good explanations and it is my personal favorite.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;Visit GeeksForGeeks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;2. W3Schools:&lt;/strong&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%2Fjy985oufepc75kkvlld8.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%2Fjy985oufepc75kkvlld8.png" alt="Image description" width="225" height="225"&gt;&lt;/a&gt;&lt;br&gt;
W3Schools is a school for web developers, covering all the aspects of web development: HTML Tutorial. CSS Tutorial. JavaScript Tutorial. PHP Tutorial.&lt;/p&gt;

&lt;p&gt;This website is also pretty much same as "Geeks For Geeks". But the explanation technic is different so it depends on if you're comfortable or not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/" rel="noopener noreferrer"&gt;Visit W3Schools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Maintainability:&lt;/strong&gt;&lt;br&gt;
While learning web development the second most annoying thing was my CSS code getting too big. It was getting hard to maintain CSS code for a complex website project. Well thanks to frameworks like TailwindCSS you always don't have to write raw CSS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;TailwindCSS:&lt;/strong&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%2Fc8smk2ydvtbphmzgx1e5.jpeg" 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%2Fc8smk2ydvtbphmzgx1e5.jpeg" alt="Image description" width="716" height="428"&gt;&lt;/a&gt;&lt;br&gt;
Tailwind CSS is an open-source CSS framework. Unlike other frameworks, like Bootstrap, it does not provide a series of predefined classes for elements such as buttons or tables. Instead, it creates a list of "utility" CSS classes that can be used to style each element by mixing and matching. &lt;/p&gt;

&lt;p&gt;TailwindCSS makes CSS codes like our previous button example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.myButton&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.myButton&lt;/span&gt; &lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Into classes like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;border-2&lt;/span&gt; &lt;span class="nt"&gt;rounded-md&lt;/span&gt; &lt;span class="nt"&gt;bg-black&lt;/span&gt; &lt;span class="nt"&gt;text-white&lt;/span&gt; &lt;span class="nt"&gt;hover&lt;/span&gt;&lt;span class="nd"&gt;:bg-white&lt;/span&gt; &lt;span class="nt"&gt;hover&lt;/span&gt;&lt;span class="nd"&gt;:text-black&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That can be added to your HTML Button Element like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"border-2 rounded-md bg-black text-white hover:bg-white hover:text-black"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click Me&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Upon other frameworks like ReactJS I'd recommend TailwindCSS for beginners. It's much easier to learn and used in production. It makes your CSS code much Maintainable. You can also use it with ReactJS increasing your code efficiency and maintainability. TailwindCSS also have docs with very detailed and easy to understand code explanations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Visit TailwindCSS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
While learning CSS might be difficult but practicing it frequently while understanding it will help a lot. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Don't just copy paste the code but also understand what it does as it is the correct way to learn CSS.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>tailwindcss</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
