<?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: victorfatala</title>
    <description>The latest articles on Forem by victorfatala (@victorfatala).</description>
    <link>https://forem.com/victorfatala</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%2F1075167%2F09cccffb-7515-442b-bb05-a4b92efb3c03.jpeg</url>
      <title>Forem: victorfatala</title>
      <link>https://forem.com/victorfatala</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/victorfatala"/>
    <language>en</language>
    <item>
      <title>Rock Music Recommendation Software</title>
      <dc:creator>victorfatala</dc:creator>
      <pubDate>Sat, 30 Sep 2023 08:34:38 +0000</pubDate>
      <link>https://forem.com/victorfatala/rock-music-recommendation-software-2nef</link>
      <guid>https://forem.com/victorfatala/rock-music-recommendation-software-2nef</guid>
      <description>&lt;p&gt;(before anything, I really just want to sat that I am not a professional, or even have many years of experience in the area, so be concerned that there may be some mistakes in my explanation. I am posting this blog as a kind of &lt;em&gt;exercise&lt;/em&gt;: explaining what I've built and how I built it, while using simple terms. In a way that anyone can understand! So feel free to make corrections and send me a feedback in the comments :)&lt;/p&gt;

&lt;h2&gt;
  
  
  A Brief Introduction...
&lt;/h2&gt;

&lt;p&gt;Hello! I started this project with the simple idea of making an &lt;strong&gt;easy&lt;/strong&gt; Python software that was capable of creating a &lt;strong&gt;good interface&lt;/strong&gt; for users to &lt;strong&gt;find what they are looking for&lt;/strong&gt; in a &lt;strong&gt;spreadsheet&lt;/strong&gt;. This could be any kind of spreadsheet, but I decided to make it 💫Rock 'n Roll💫 themed!🤘🏻🧑🏻‍🎤&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9wk5v47hu352ge6832qw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9wk5v47hu352ge6832qw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if matching the user input to the closest value in the spreadsheet wasn't enough, I have also included a sort of "autocomplete" search algorithm:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmm7flexsilzfdbpn1hhz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmm7flexsilzfdbpn1hhz.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you may be wondering: why a spreadsheet? Well, from all the possibilities, it seemed to me that spreadsheets would be both: a good file type to practice (working with .CSV), and the simplest way for anyone to try this software on their own (as basically anyone knows how to use Excel or Google Sheets). 🧠&lt;/p&gt;

&lt;h2&gt;
  
  
  Gathering Data
&lt;/h2&gt;

&lt;p&gt;To able to achieve this software I firstly needed to convert my spreadsheet into a more &lt;em&gt;programmable&lt;/em&gt; kind of data. So I decided to set up a function to collect all the data stored in my .CSV file and organize it in a &lt;strong&gt;Tree Node&lt;/strong&gt; structure. This made things much easier to manage since I was already thinking of something like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Genres&lt;/strong&gt; are composed of &lt;strong&gt;Artists&lt;/strong&gt;. 👯&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Artists&lt;/strong&gt; (usually) produce &lt;strong&gt;Albums&lt;/strong&gt;. 💿&lt;/li&gt;
&lt;li&gt;And &lt;strong&gt;Albums&lt;/strong&gt; are a collection of &lt;strong&gt;Songs&lt;/strong&gt;. 🎶&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which, in a Tree, is basically:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F4cpmuv8xwego51hozipy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4cpmuv8xwego51hozipy.jpg" alt="Tree Structure example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;generate_tree()&lt;/code&gt; function is the one responsible for setting each value in its specific position in the Tree. 🌳&lt;/p&gt;

&lt;p&gt;You can see the whole Tree generated by typing 'Library':&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnj2vv8cmidamrlrfnkhd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnj2vv8cmidamrlrfnkhd.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we have our Tree, all we need to do is search in it for the value asked by the user. Which takes us to...&lt;/p&gt;

&lt;h2&gt;
  
  
  Tree Search
&lt;/h2&gt;

&lt;p&gt;For this project I decided to implement a &lt;strong&gt;Breadth-First&lt;/strong&gt; Search algorithm. This works basically by following a &lt;strong&gt;FIFO&lt;/strong&gt; (First In First Out) order to compare each &lt;strong&gt;Node&lt;/strong&gt; in our &lt;strong&gt;Tree&lt;/strong&gt; with the goal value (the value asked by the user). By using this FIFO ordering, we end up looking at each layer of the Tree before moving to the layer below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F3s12krl0dtwsad826y94.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F3s12krl0dtwsad826y94.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the &lt;strong&gt;current Node&lt;/strong&gt; is equal to the goal Node — 💥 BOOM!💥 — we got it! All we need to do is &lt;strong&gt;return&lt;/strong&gt; the path to this Node (which we save at each step, using some loops). Otherwise, if we get to the end of the Tree without a match 💔 we return an empty path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interface
&lt;/h2&gt;

&lt;p&gt;And, with all the values returned by these functions, the only thing left to do is present them to the user. 👀&lt;/p&gt;

&lt;p&gt;Just mix some conditions and String concatenation with all these and &lt;em&gt;tah-dah&lt;/em&gt;: 🪄&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vifatala/Rock-Music-Recommendation-Software/blob/main/tree_search.py" rel="noopener noreferrer"&gt;https://github.com/vifatala/Rock-Music-Recommendation-Software/blob/main/tree_search.py&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>database</category>
    </item>
    <item>
      <title>Python Terminal DEMO RPG Game</title>
      <dc:creator>victorfatala</dc:creator>
      <pubDate>Tue, 02 May 2023 02:54:18 +0000</pubDate>
      <link>https://forem.com/victorfatala/python-terminal-demo-rpg-game-20hg</link>
      <guid>https://forem.com/victorfatala/python-terminal-demo-rpg-game-20hg</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FQcLj3xO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mla3kmvfc5vwdediz9lw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FQcLj3xO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mla3kmvfc5vwdediz9lw.png" alt="The game's logo: &amp;quot;The Lost Dungeon&amp;quot;" width="601" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this project I developed a (very short) Python text-based RPG game in which multiple choices can be made, different dialogues bring different responses, and each character has their very own personality. All of this combined with a slight amount of silliness! 🍌&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X6oKpLqm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40b9tu1teu1kjiq5ygf9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X6oKpLqm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40b9tu1teu1kjiq5ygf9.gif" alt='A GIF showing the beginning of the game with a letter and a blinking message saying: "You got mail!"' width="350" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code was mostly developed by me (with some help from Stack Overflow I won't lie) and entirely written in Python. I took this project as a chance to challenge myself to maximum while doing some stuff I really enjoy for my first portfolio project: games. 👾&lt;/p&gt;

&lt;p&gt;Functions such as &lt;em&gt;textAnimation()&lt;/em&gt;, &lt;em&gt;menu()&lt;/em&gt;, and &lt;em&gt;phoneMessage()&lt;/em&gt;, are some of the most complex and interesting parts of my code which you might be interested in taking a look! 🔍&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IEIRxEh_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zh41rr59uz7ar047n4h.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IEIRxEh_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zh41rr59uz7ar047n4h.gif" alt="Mark the Aadvark" width="343" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All in all, I can say I had a lot fun developing this game and that's why I really hope you also enjoy! ❤️&lt;/p&gt;

&lt;p&gt;(My only wish was that I could make the &lt;strong&gt;dungeon&lt;/strong&gt; actually appear, but I took too much time on that phone thing...)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vifatala/Python-Terminal-Game.git"&gt;https://github.com/vifatala/Python-Terminal-Game.git&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>gamedev</category>
      <category>github</category>
    </item>
  </channel>
</rss>
