<?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: Aradhya Kumar Chandra</title>
    <description>The latest articles on DEV Community by Aradhya Kumar Chandra (@redhat143).</description>
    <link>https://dev.to/redhat143</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%2F3972760%2F8198d6ce-b306-45df-ba54-6425e1c66b97.jpeg</url>
      <title>DEV Community: Aradhya Kumar Chandra</title>
      <link>https://dev.to/redhat143</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/redhat143"/>
    <language>en</language>
    <item>
      <title>Created Maze AI from scratch in HighSchool</title>
      <dc:creator>Aradhya Kumar Chandra</dc:creator>
      <pubDate>Thu, 11 Jun 2026 20:11:12 +0000</pubDate>
      <link>https://dev.to/redhat143/created-ai-from-scratch-in-my-final-year-of-highschool-1hc3</link>
      <guid>https://dev.to/redhat143/created-ai-from-scratch-in-my-final-year-of-highschool-1hc3</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Basic Pillars of AI based on Human Thinking~&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;My First step into Artificial Intelligence&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As, we all know, an AI ~&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Takes &lt;strong&gt;decision&lt;/strong&gt; on it's own&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It &lt;strong&gt;stores it's mistakes&lt;/strong&gt; and &lt;strong&gt;learns&lt;/strong&gt; from it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It makes sure it &lt;strong&gt;does not repeat any mistake&lt;/strong&gt; in future and thus takes &lt;strong&gt;better decisions&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, if we incoperate this logic into the programming, we will have made an AI!!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Making of Maze AI&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;My First AI project&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, I am quite trained in &lt;strong&gt;Python&lt;/strong&gt; and have been using it for 3 years now.&lt;br&gt;
Hence, I started answering each and every question one by one ~&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;"How to make a maze ?" -&amp;gt; Use pygame&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"How to know when to take decisions ?" -&amp;gt; We can throw yellow balls both up and down direction, and wherever it &lt;strong&gt;collides with vertical wall&lt;/strong&gt;, to detect whether their is opening on top or not.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Obstruction on top wall,(simply uses rect1.colliderect(rect2) to move forward) ~&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%2F09a57bcs601bennshcz9.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%2F09a57bcs601bennshcz9.png" alt="Stickman facing obstruction on top wall in maze" width="216" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And, if no obstruction both up and down, means it has to take &lt;strong&gt;decision&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%2F3fgnpi5ph1o3niowp7qe.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%2F3fgnpi5ph1o3niowp7qe.png" alt="Stickman colliding with vertical wall, therefore throwing yellow decision balls(Up and Down) to make decision " width="275" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3."How to take decision ?" -&amp;gt; Use random module,deciding to go either &lt;strong&gt;UP&lt;/strong&gt; or &lt;strong&gt;DOWN&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"TAKING DECISION" : CHECK ✅&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;4."How to know final mistake/blockage(Deadend)" -&amp;gt; When it finally collides with a wall and both the yellow balls detects blockage&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%2Faric94c9edu8bsplcp2r.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%2Faric94c9edu8bsplcp2r.png" alt="Stickman facing a deadend, therfore storing that its previous decision was wrong(say Up, so therfore it will take Decision Down next time)" width="379" height="174"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;It then records that the prev pos. where it took the DECISION,(say,Up), was wrong, and next time it should take decision Down&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After facing the blockage, the stickman &lt;strong&gt;automatically re-spawn and restarts&lt;/strong&gt; at the &lt;strong&gt;starting position.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;5."How to store mistakes ?" -&amp;gt; Use dictionary, in form of {(x,y):decision}, [where : (x,y) is the coordinate where it took the dicision(Up/Down)]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"STORING MISTAKES" : CHECK ✅&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;6."How not to repeat mistakes in future ?" -&amp;gt; While taking decision(Up/Down),I started checking the mistakes dict to know whether at that pos a mistake decision was recorded or not(say {(20,30):"Up"}), if yes, it takes other decision("Deciding Down due to mistake")&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"NOT REPEATING MISTAKES IN FUTURE" : CHECK ✅&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;7.Now, a major part which made me &lt;strong&gt;Hustle a Lot&lt;/strong&gt; ~&lt;br&gt;
say, mistakes={(30,40):"Down"}&lt;br&gt;
in which it first took decision at (10,20) &lt;strong&gt;"Down"&lt;/strong&gt;, then moving forward again took decision at (30,40)&lt;/p&gt;

&lt;p&gt;Next, time it takes decision Up at (30,40) and again face a blockage&lt;br&gt;
it will then store {(30,40):"UpDown"}&lt;/p&gt;

&lt;p&gt;So, therefore if &lt;strong&gt;any coordinate has "UpDown" both in them, their previous decision which led to this will automatically has to update it&lt;/strong&gt; -&amp;gt; {(10,20):"Down",(30,40):"UpDown"}&lt;/p&gt;

&lt;p&gt;8.&lt;strong&gt;The Last Thing&lt;/strong&gt; -&amp;gt; I put a prize at end, so that when stickman reaches the prize, it knows that the maze is &lt;strong&gt;complete&lt;/strong&gt;&lt;br&gt;
Therefore, using best_path list to always follow the shortest optimum path and use less time.&lt;/p&gt;

&lt;p&gt;9.I also import &lt;strong&gt;time module&lt;/strong&gt;, to calculate the time it took to find the prize, and the final time it takes to follow the best path when it has found the prize.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;THE MAZE&lt;/strong&gt;~
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The Final Output and Results of my AI&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hence, I build The Maze, The Stickman and The Prize ~&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%2Fe1z0ioa9dkp7k3jy0lcx.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%2Fe1z0ioa9dkp7k3jy0lcx.png" alt="The stickman standing in front of the entire Tree branch maze and prize at the end" width="800" height="450"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;When I hit Spacebar, it starts moving and as it faces blockages,takes decisions,stores them, or take different decsion due to a registered mistake, It shows the following on screen ~ &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%2Fm9p5eqvlvi9vweacjr3f.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%2Fm9p5eqvlvi9vweacjr3f.png" alt="Python IDLE screen showing outputs of where it takes decision,where blocked,where it changes decision due to mistakes dict" width="733" height="663"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When, it finally reaches the prize, it prints the time taken and the best optimum path it configured ~&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%2Fj6rfstlrulgtoex8dsp9.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%2Fj6rfstlrulgtoex8dsp9.png" alt="Showing the time taken to reach the prize is 23.19 secs and the best_path list" width="737" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, No matter how many times I run it, it will always use the best path and it will take the least time to reach the prize ~&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%2Fpiuu7czpwo13gzg1bnng.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%2Fpiuu7czpwo13gzg1bnng.png" alt="Python Idle showing in all the next run(shown 2 here), it always take the best path taking time approx 6.5 secs (6.53 and 6.42 secs to be precise)" width="731" height="630"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;LIMITATIONS&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Every First Project has some limitations"&lt;br&gt;
-Me (2026)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Its, currently just at phase 1 MVP(Minimum Viable Product)&lt;br&gt;
The Limitations of my MAZE AI are ~&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The stickman can for now only move in &lt;strong&gt;Up,Down and Right(Forward)&lt;/strong&gt;, direction.It &lt;strong&gt;cannot turn Backward or go Left&lt;/strong&gt;.&lt;br&gt;
Therfore, whenever facing a deadend, I have to restart at original point&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It, thus works in a &lt;strong&gt;unidirectional Tree Branch Maze.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It can only detect the &lt;strong&gt;top-most or the lower-most walls&lt;/strong&gt; for moving forward.But if, its stuck in a loop and there is a opening at the wall in the &lt;strong&gt;middle&lt;/strong&gt; or lower or upper than the extreme ends, it &lt;strong&gt;cannot enter it&lt;/strong&gt; and will &lt;strong&gt;go on and on in the loop&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Help Me Improve: What's the next step ?
&lt;/h2&gt;

&lt;p&gt;Now, that the phase-1 is complete, I would like to get at phase 2 and get new ideas on what new and interesting things I can do with it.And How can I make the stickman navigate through complex mazes!&lt;/p&gt;

&lt;p&gt;Also, since this was just a project I did at home,just for &lt;strong&gt;my own interest,hobby and love for CS&lt;/strong&gt;.&lt;br&gt;
I wanna know whether there are any &lt;strong&gt;competitions or platforms&lt;/strong&gt; where I can &lt;strong&gt;show my project/maze ai&lt;/strong&gt; and partcipate with other people, or get to showcase my project.I would love to get this project out there!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drop your ideas,advices,projects,or infos on where can I showcase my project, down in the comments below 👇&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>ai</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
