<?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: Add00</title>
    <description>The latest articles on DEV Community by Add00 (@add00_3).</description>
    <link>https://dev.to/add00_3</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%2F2104547%2F3e918c97-d3c4-4990-ba02-35704e580ad2.png</url>
      <title>DEV Community: Add00</title>
      <link>https://dev.to/add00_3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/add00_3"/>
    <language>en</language>
    <item>
      <title>Minesweeper Release</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Thu, 12 Dec 2024 04:43:56 +0000</pubDate>
      <link>https://dev.to/add00_3/minesweeper-release-k6h</link>
      <guid>https://dev.to/add00_3/minesweeper-release-k6h</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;Last &lt;a href="https://dev.to/add00_3/minesweeper-progress-1974"&gt;time&lt;/a&gt;, I gave an update on my progress. I'm pleased to say I've made a &lt;a href="https://github.com/litecanvas/games/pull/3" rel="noopener noreferrer"&gt;PR&lt;/a&gt; and I'm waiting for the maintainer to approve it. &lt;/p&gt;

&lt;p&gt;To solve the issue I mentioned previously about communicating between different parts of the program I opted to use the EventEmitter pattern which involves emitting events and having preset functions to respond to those events. This is very similar to how events such as clicks or button presses are handled in the &lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/DOM" rel="noopener noreferrer"&gt;DOM&lt;/a&gt;. Once I created a class to implement this pattern I realized that I could simply many parts of my existing code to use this pattern. Such as an event for when the game ends.&lt;/p&gt;

&lt;p&gt;I also reworked the time tracking class to not only differ between long and short presses, but to also track duration. This allowed me to add a timer showing the player how long it took them to complete the game. I also wanted to have a scoreboard with the best times, but I felt it was out of scope as it was a single-player game only so it would only have the players scores.&lt;/p&gt;

&lt;p&gt;The last thing I added were some win and loss effects using &lt;a href="https://killedbyapixel.github.io/ZzFX/" rel="noopener noreferrer"&gt;ZzFX&lt;/a&gt; a tool I had not used previously, but I think I will use more going forwards as it has a lot of functionality and a small file size. &lt;/p&gt;

&lt;p&gt;Overall, I felt I got to add everything a minesweeper game has, randomly placed mines, numbers showing the adjacent mines, ability to reveal squares and place flags, as well as a game timer, and win/loss screens. Starting from release 0.2 to 0.4 it was very exciting to work with this engine and build increasingly large projects, to end with a fully working game. It is quite satisfying.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Minesweeper Progress</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Thu, 12 Dec 2024 04:17:15 +0000</pubDate>
      <link>https://dev.to/add00_3/minesweeper-progress-1974</link>
      <guid>https://dev.to/add00_3/minesweeper-progress-1974</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;Last &lt;a href="https://dev.to/add00_3/planning-minesweeper-foh"&gt;time&lt;/a&gt;, I was working on my plans for developing a Minesweeper clone for the &lt;a href="https://github.com/litecanvas/game-engine" rel="noopener noreferrer"&gt;litcanvas&lt;/a&gt; engine. Like any plan for a programming project it had to be modified along the way as their was many unique technical challenges I did not think about when originally planning it.&lt;/p&gt;

&lt;p&gt;For example one problem I didn't realize I had to face was the fact that the engine did not have away to detect right clicks on the mouse. Since I needed to inputs one for revealing mines and another for placing flags. My solution was to track how long the user was clicking for and if it was a long press a flag would be placed otherwise it was a short press and the square could be revealed. &lt;/p&gt;

&lt;p&gt;Another issue that I had to find a solution for was how to reveal all tiles which had zero mines as a neighbor. Originally, I wanted to develop a loop based approach for finding all of the neighboring squares. However, if there is a loop based approach I could not get it to work, so I switched to a recursive algorithm which would check each square and each of that squares' neighboring until it found one boarding a mine.&lt;/p&gt;

&lt;p&gt;With the fundamental parts of the game complete I now need to work on a way of displaying the game in a visually interesting way and to communicate actions between different parts of the program.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Planning Minesweeper</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Fri, 06 Dec 2024 04:49:11 +0000</pubDate>
      <link>https://dev.to/add00_3/planning-minesweeper-foh</link>
      <guid>https://dev.to/add00_3/planning-minesweeper-foh</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;For the final project of this semester I wanted to continue contributing to the &lt;a href="https://github.com/litecanvas/game-engine" rel="noopener noreferrer"&gt;game engine&lt;/a&gt; I had been making previous contributions to. So I made an &lt;a href="https://github.com/litecanvas/utils/issues/20" rel="noopener noreferrer"&gt;issue&lt;/a&gt; asking the main developer if I could add a &lt;a href="https://en.wikipedia.org/wiki/Inbetweening" rel="noopener noreferrer"&gt;tween&lt;/a&gt; animation system. It turned out the developer already had one and I had some how missed it. So, I turned to my back up plan and asked if the developer was interested in &lt;a href="https://en.wikipedia.org/wiki/Rigid_body" rel="noopener noreferrer"&gt;rigid body&lt;/a&gt; physics. Unfortunately, it turned out that it was not a feature inline for the maintainers vision of the engine.&lt;/p&gt;

&lt;p&gt;However, he did suggest that I make an example game. This was a very good suggestion so I decided to make &lt;a href="https://en.wikipedia.org/wiki/Minesweeper_(video_game)" rel="noopener noreferrer"&gt;Minesweeper&lt;/a&gt; a game about finding all the cells without mines in them. For this project I opted for an object oriented approach. I plan to have a Tile class to represent a cell which would store the number of adjacent mines, and if itself is a mine. As well as a Board class which would store the 2d array storing the tiles as well as a method to draw it. Finally, there would be an Interaction class to handle user mouse events as they click on the cells in the game.&lt;/p&gt;

&lt;p&gt;While I know how to play Minesweeper, programming it is a different challenge and I look forwards to it!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Releasing a Package</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Sat, 23 Nov 2024 04:06:44 +0000</pubDate>
      <link>https://dev.to/add00_3/releasing-a-package-2j44</link>
      <guid>https://dev.to/add00_3/releasing-a-package-2j44</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;With the end of the semester approaching, this weeks assignment was about making our CLI tool available. Since, this project was built in JavaScript it made the most sense to release the package on &lt;a href="//npmjs.com/"&gt;NPM&lt;/a&gt;, the most popular JS registry in the node ecosystem. &lt;/p&gt;

&lt;p&gt;To create the release I first made a &lt;code&gt;.npmignore&lt;/code&gt; file which would prevent unnecessary files for testing, and documentation from being installed on the users device. This file follows a similar syntax to &lt;code&gt;.gitignore&lt;/code&gt; file. Then, I created an NPM account. After that I ran &lt;code&gt;npm login&lt;/code&gt; to sign in from the terminal in my project. Before publishing the project to NPM I made sure to tag the current commit with &lt;code&gt;git tag -a v0.9.0 -m "version 0.9.0"&lt;/code&gt;. So that the project would have a proper version number. Finally, I ran &lt;code&gt;npm publish&lt;/code&gt; to make it publicly available on the &lt;a href="https://www.npmjs.com/package/docbot" rel="noopener noreferrer"&gt;internet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To have the code function as a library I had to modify the &lt;code&gt;main.js&lt;/code&gt; to export it's function instead of call it directly. This is a more flexible solution as other developers can use the function as they see fit.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Quadtrees!</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Thu, 21 Nov 2024 01:14:43 +0000</pubDate>
      <link>https://dev.to/add00_3/quadtrees-2op8</link>
      <guid>https://dev.to/add00_3/quadtrees-2op8</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;Having spent most of the past week working on &lt;a href="https://dev.to/add00_3/procedural-generation-and-noise-3f8f"&gt;Procedural Generation and Noise&lt;/a&gt;. I needed to find another topic for a second issue. So I was scrolling the list of &lt;a href="https://github.com/litecanvas/utils/issues/" rel="noopener noreferrer"&gt;issues&lt;/a&gt; available for &lt;a href="https://github.com/litecanvas/utils" rel="noopener noreferrer"&gt;Litecanvas&lt;/a&gt; and noticed one for creating Quadtrees. &lt;/p&gt;

&lt;p&gt;I had many questions, what was a Quadtree? Where do they go? How many are ideal? And do they taste good? I was able to find satisfactory answers to all but one of my questions in my search. So I asked the repo owner if I could work on the &lt;a href="https://github.com/litecanvas/utils/issues/16" rel="noopener noreferrer"&gt;issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A &lt;a href="https://en.wikipedia.org/wiki/Quadtree" rel="noopener noreferrer"&gt;Quadtree&lt;/a&gt; is a tree type data structure which is an an efficient way to store spacial information. Each node in the tree has 4 child trees within it, this is a recursive relation ship. Visually a Quadtree looks something like this: &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%2Fy6ieupw5b196uoo5kljw.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%2Fy6ieupw5b196uoo5kljw.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Where points can be found based on where they are located in the Quadtree. To create a Quadtree I first created a point and rectangle class, points would be stored in the tree, and a rectangle would be used to check for points within an area.&lt;/p&gt;

&lt;p&gt;Then I created the Quadtree class which would hold the points and automatically subdivide into more Quadtrees as required. For debuging and testing reasons I also made a show function to visualize the changes. Once complete, I made my &lt;a href="https://github.com/litecanvas/utils/pull/19" rel="noopener noreferrer"&gt;PR&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This concludes release 0.3, 0.4 is on the horizon!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Procedural Generation and Noise</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Thu, 21 Nov 2024 00:47:26 +0000</pubDate>
      <link>https://dev.to/add00_3/procedural-generation-and-noise-3f8f</link>
      <guid>https://dev.to/add00_3/procedural-generation-and-noise-3f8f</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;For this most recent assignment we were tasked with contributing a larger feature to an open source project. During my time with the previous assignment I worked on a game engine called &lt;a href="https://github.com/litecanvas/game-engine" rel="noopener noreferrer"&gt;Litecanvas&lt;/a&gt;, inspired engine by libraries like &lt;a href="https://www.raylib.com/" rel="noopener noreferrer"&gt;raylib&lt;/a&gt; and &lt;a href="https://p5js.org/" rel="noopener noreferrer"&gt;p5.js/Processing&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Having gotten a better understanding of the engine and it's capabilities, I noticed that it was missing procedural generation. Procedural generation is a technique of creating pseudo-random values that form patterns or textures as apposed to pure randomness. Which looks well random... Honestly, it's easier to see what pseudo-random looks like visually: &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%2Fd7m04mouuplztmo84csv.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%2Fd7m04mouuplztmo84csv.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Originally, my plan was to learn the math behind pseudo-random generator known as &lt;a href="https://en.wikipedia.org/wiki/Perlin_noise" rel="noopener noreferrer"&gt;Perlin noise&lt;/a&gt;. Then create my own implementation, as I did with &lt;a href="https://dev.to/add00_3/hackoberfest-part-3-3id2"&gt;raycasting&lt;/a&gt;. However, it turns out that unlike raycasting which is composed of high-school level trigonometry. Perlin noise requires a lot more complicated math then I could understand or have the time to understand.&lt;/p&gt;

&lt;p&gt;This led to my second plan addapt a C++ Perlin noise library creatively called &lt;a href="https://github.com/Reputeless/PerlinNoise" rel="noopener noreferrer"&gt;PerlinNoise&lt;/a&gt;, into JavaScript to work with Litecanvas. So I made an &lt;a href="https://github.com/litecanvas/game-engine/issues/88" rel="noopener noreferrer"&gt;issue &lt;/a&gt;asking if the engine author wanted this feature. They said they were fine with me working on this issue, but to look at the &lt;a href="https://github.com/processing/p5.js/blob/v1.11.1/src/math/noise.js#L36" rel="noopener noreferrer"&gt;p5.js Perlin noise&lt;/a&gt; library for assistance.&lt;/p&gt;

&lt;p&gt;Which led to the third plan, adapt the existing JS version! This while not being super easy was much better then writing a version from nothing or from a different language. So I began working on the adaptation, figuring out the correct way to interface with the engine was a bit troublesome, but there was many great examples that existed that I followed. Once compete I made a &lt;a href="https://github.com/litecanvas/utils/pull/18" rel="noopener noreferrer"&gt;PR&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The PR is still awaiting approval as I only submitted it recently, to ensure the code was properly documented and commented. Through out this process I learned that not everything has to be done from a low level or from scratch. I can still learn a lot by working with code at a high level.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Continuous Integration and Continuous Learning</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Sat, 16 Nov 2024 03:30:18 +0000</pubDate>
      <link>https://dev.to/add00_3/continuous-integration-and-continuous-learning-16fg</link>
      <guid>https://dev.to/add00_3/continuous-integration-and-continuous-learning-16fg</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;Entering week 10 of the open source course. We have been assigned to learn about a topic that has always interested me Continuous Integration (CI) Workflows, and automated testing. I've always wanted to work with &lt;a href="https://github.com/features/actions" rel="noopener noreferrer"&gt;GitHub Actions&lt;/a&gt;, and this weeks assignment gave the perfect time to do it. &lt;/p&gt;

&lt;p&gt;Setting up this workflow was very simple, as the project tests were also simple. The default template GitHub Action for NodeJS testing was able to work out of the box. It functions on every PR and push to the main branch and runs the &lt;code&gt;npm test&lt;/code&gt; command which runs the full suite of tests on three major versions on Node.&lt;/p&gt;

&lt;p&gt;The full file can be seen below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Node.js CI&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;18.x&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;20.x&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;22.x&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="c1"&gt;# See supported Node.js release schedule at https://nodejs.org/en/about/releases/&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Use Node.js ${{ matrix.node-version }}&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.node-version }}&lt;/span&gt;
        &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm run build --if-present&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Writing tests for my &lt;a href="https://github.com/cduarte3/f2read" rel="noopener noreferrer"&gt;partners&lt;/a&gt; repo was interesting as they had used a different testing framework. They had opted to use Jest where I was using Vitest while syntactically similar the functions had some slight differences. Given that they had very good test coverage out of the gate, I only opted to add some minor tests for some edge cases.&lt;/p&gt;

&lt;p&gt;Having implemented CI for this assignment while not a very complex implementation. The fact that a basic automated testing system is just a few clicks away is new information to me. Seeing this I look forwards to adding this to more of my personal project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Test Test Test</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Sat, 09 Nov 2024 00:53:19 +0000</pubDate>
      <link>https://dev.to/add00_3/test-test-test-jp5</link>
      <guid>https://dev.to/add00_3/test-test-test-jp5</guid>
      <description>&lt;p&gt;Can you hear me?&lt;/p&gt;

&lt;p&gt;Greetings, another week another lab this week covered the topic of automated testing. When selecting a test framework my first thought was to use &lt;a href="https://jasmine.github.io/" rel="noopener noreferrer"&gt;Jasmine&lt;/a&gt;, which I had used previously, however it turns out that Jasmine does not have good support for ES modules. After doing a bit of research I opted to go with &lt;a href="https://vitest.dev/" rel="noopener noreferrer"&gt;Vitest&lt;/a&gt;, since it was ES module compatible, and was inter-compatible with the very popular &lt;a href="https://vite.dev/" rel="noopener noreferrer"&gt;Vite&lt;/a&gt; tool chain. &lt;/p&gt;

&lt;p&gt;Getting started with Vitest was very simple first I installed is a development dependency using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -D vitest&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then I added a test script to the &lt;code&gt;package.json&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"test": "vitest"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;While custom configs can be set using a &lt;code&gt;vitest.config.ts&lt;/code&gt; file, due to the straight forward nature of my project it was not necessary to have one.&lt;/p&gt;

&lt;p&gt;While writing the tests I realized that I had structured the code quite poorly and had put too much code into the &lt;code&gt;main.js&lt;/code&gt; file. Since the main file acts as the entry point to the program and the main function cannot be exported. To ensure everything could be thoroughly tested I made a new &lt;code&gt;chat.js&lt;/code&gt; and &lt;code&gt;utils.js&lt;/code&gt; and moved non-entry related code into them. Then made corresponding test files.&lt;/p&gt;

&lt;p&gt;In the testing process I ended up finding and fixing several bugs one of them being that I had created a custom Ollama client, but it was never used instead the default Ollama client was used to make requests.&lt;/p&gt;

&lt;p&gt;Going forwards I think I will use Vitest as my primary testing suite for personal projects. While using it I did have problems, but those problems where of my own making! Whereas, with Jasmine, and other testing tools I've run into issues involving the tool itself which is never ideal. Especially for a testing kit.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Formatting and Linting</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Fri, 01 Nov 2024 21:49:20 +0000</pubDate>
      <link>https://dev.to/add00_3/formatting-and-linting-472b</link>
      <guid>https://dev.to/add00_3/formatting-and-linting-472b</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;For this assignment we had to add a formatter and linter to our projects. I opted to go with ESLint and Prettier and as they work well in the JS/Node ecosystem. Both tools are widely used, well-documented, and have strong community support.&lt;/p&gt;

&lt;p&gt;After installing, I ran ESLint and Prettier commands. ESLint highlighted a few code issues, such as unused variables. Then Prettier flagged areas where formatting was inconsistent and fixed it. Some ESLint errors were fixed automatically, while others required manual refactoring, which helped improve the overall structure of the code.&lt;/p&gt;

&lt;p&gt;Setting up ESLint and Prettier helped me a lot about the importance of static analysis. Using these tools help to standardized the code between developers and also reduced errors. I feel this would likely reducing the need for stylistic changes in pull requests.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hackoberfest: Part 4</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Fri, 01 Nov 2024 02:31:05 +0000</pubDate>
      <link>https://dev.to/add00_3/hackoberfest-part-4-2gh1</link>
      <guid>https://dev.to/add00_3/hackoberfest-part-4-2gh1</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;For this final part I wanted to do something that was still interesting, but not a time consuming as making a custom pseudo &lt;a href="https://dev.to/add00_3/hackoberfest-part-3-3id2"&gt;ray-casting engine&lt;/a&gt;. So using the game engine I became very familiar with I saw their was an &lt;a href="https://github.com/litecanvas/game-engine/issues/9" rel="noopener noreferrer"&gt;issue&lt;/a&gt; to implement &lt;a href="https://en.wikipedia.org/wiki/Tic-tac-toe" rel="noopener noreferrer"&gt;tic-tac-toe&lt;/a&gt; a simple but popular game.&lt;/p&gt;

&lt;p&gt;So I requested permission to work on the topic and started right away. First I setup some code to draw the game board to the screen then when a click event happens it will map the pixel coordinates click to the corresponding cell in a 3 by 3 array storing the previously placed pieces.&lt;/p&gt;

&lt;p&gt;Then it will check to see if the "X" or "O" player has won if it hasn't it will cycle back to waiting for a click. Once a player has one or tied it will show a win message and end the game.&lt;/p&gt;

&lt;p&gt;That concludes the Hackoberfest saga it was really quite the learning experience. I feel there was a lot of things, in particular time management better. Now that I've gone through this contributing to open source does not stress me out as much as it used to and I think I'm better at managing time.&lt;/p&gt;

&lt;p&gt;The next post will be your regular scheduled programming about the AI CLI tool and Static Analysis.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hackoberfest: Part 3</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Fri, 01 Nov 2024 02:11:13 +0000</pubDate>
      <link>https://dev.to/add00_3/hackoberfest-part-3-3id2</link>
      <guid>https://dev.to/add00_3/hackoberfest-part-3-3id2</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;Now for this third part I wanted to do something much more major and which would be cool! So I found a relatively obscure 2D game engine written in JS called &lt;a href="https://github.com/litecanvas/game-engine" rel="noopener noreferrer"&gt;Litecanvas&lt;/a&gt;. It is similar to tools like p5.js or raylib which I have some previous experience with.&lt;/p&gt;

&lt;p&gt;I noticed there was a long standing &lt;a href="https://github.com/litecanvas/game-engine/issues/8" rel="noopener noreferrer"&gt;issue&lt;/a&gt; regarding simulating 3D. This is a topic that has interested me for many years so I decided to try and solve this issue myself using a &lt;a href="https://en.wikipedia.org/wiki/Ray_casting#Concept" rel="noopener noreferrer"&gt;ray-casting&lt;/a&gt; technique. However, I wanted to avoid the awkwardness of asking for the issue then being unable to complete the task. &lt;/p&gt;

&lt;p&gt;So I spent a week researching and testing hoping that no one else would take the issue in the mean time. Honestly, looking back I should have just asked for the issue in the first place the maintainer is a very nice person.&lt;/p&gt;

&lt;p&gt;It turns out high school trigonometry has a lot of uses for ray-casting which is quite exciting for someone who hasn't had a good use for it. The solution I opted for works in the following way.&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%2Ffa6oqwh0m76q2hetnpdn.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%2Ffa6oqwh0m76q2hetnpdn.png" alt="Image description" width="772" height="771"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First rays are projected out from the player and they record the distance from the wall to the player. The longer the ray the further the wall. Each ray will correspond to a single column in the players' first person field of view.&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%2Fv06ussdtt3ip07tvmq83.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%2Fv06ussdtt3ip07tvmq83.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;br&gt;
The first person point of view is then generated by taking the lengths of the rays, with longer rays meaning the wall is drawn smaller since it is further away and shorter rays meaning the wall is drawn longer since it is closer.&lt;/p&gt;

&lt;p&gt;This glosses over some of the more complex parts like the fixing the &lt;a href="https://gamedev.stackexchange.com/questions/97574/how-can-i-fix-the-fisheye-distortion-in-my-raycast-renderer#97580" rel="noopener noreferrer"&gt;fish eye effect&lt;/a&gt;. However, you can view the &lt;a href="https://github.com/litecanvas/game-engine/pull/81" rel="noopener noreferrer"&gt;PR&lt;/a&gt; see the it all for yourself. &lt;/p&gt;

&lt;p&gt;Overall, although this took me wayyy longer then I thought it would I'm quite please with the &lt;a href="https://github-production-user-asset-6210df.s3.amazonaws.com/60050879/381737886-13981e6c-e3fb-4147-9e4d-83746961bccf.webm?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;amp;X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20241101%2Fus-east-1%2Fs3%2Faws4_request&amp;amp;X-Amz-Date=20241101T021011Z&amp;amp;X-Amz-Expires=300&amp;amp;X-Amz-Signature=d75f974b87fe41fa912eb4655206b612923a69e85498e115ff9847d59e87ccc0&amp;amp;X-Amz-SignedHeaders=host" rel="noopener noreferrer"&gt;final product&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hackoberfest: Part 2</title>
      <dc:creator>Add00</dc:creator>
      <pubDate>Fri, 01 Nov 2024 01:39:54 +0000</pubDate>
      <link>https://dev.to/add00_3/hackoberfest-part-2-3mbc</link>
      <guid>https://dev.to/add00_3/hackoberfest-part-2-3mbc</guid>
      <description>&lt;p&gt;Greetings,&lt;/p&gt;

&lt;p&gt;So uh in my &lt;a href="https://dev.to/add00_3/hackoberfest-part-1-1b8j"&gt;last post&lt;/a&gt; I said that I would be doing something much bigger the following week. But sometimes life happens and you are not able to do things when you expect them and 2 weeks pass and you haven't created some good contributions. To remedy this issue I have opted create create those contributions and this week blog about each of them now.&lt;/p&gt;

&lt;p&gt;The first contribution I would like to talk about was in relation to an &lt;a href="https://github.com/codethesaurus/codethesaur.us/issues/739" rel="noopener noreferrer"&gt;issue&lt;/a&gt; on the Codethesaur project which aims to be a dictionary between different languages. The owner was looking for some assistance with adding Kotlin to the dictionary.&lt;/p&gt;

&lt;p&gt;I've always wanted to learn Kotlin so I took the chance and requested to be assigned an issue describing the various builtin operators in the language. Using the &lt;a href="https://kotlinlang.org/docs/home.html" rel="noopener noreferrer"&gt;language documentation&lt;/a&gt; and &lt;a href="https://play.kotlinlang.org/" rel="noopener noreferrer"&gt;playground&lt;/a&gt; I was able to learn the operators and describe them into a JSON file which I contributed. &lt;/p&gt;

&lt;p&gt;During the &lt;a href="https://github.com/codethesaurus/codethesaur.us/pull/761" rel="noopener noreferrer"&gt;PR&lt;/a&gt; process I learned a bit about automated testing, as the project had several. It turns out I was failing a docker test even though I had not touched any docker related code. I spent good amount of time trying to fix what I thought I had broken. It turns out one of the project dependencies needed an update. So the PR could be accepted with little change.&lt;/p&gt;

&lt;p&gt;The next post will be about game development!&lt;/p&gt;

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