Programmer, game developer, legal citizen of the United States.

Category: Code Samples

Code Sample – Spam Filter (using Naïve Bayes Algorithm)

Below is a code sample of a spam filter I wrote for my MAT345 course, Intro to Data Science. This sample shows a full process of parsing and cleaning data, training a machine learning algorithm, and testing the algorithm’s performance against a known data set. Throughout my implementation of the Naïve Bayes algorithm, I kept focus on utilizing the C++ STL to simplify the complexity, run-time, and readability of my code.

Code Sample – Polygon vs. Polygon Collision Detection (with SAT)

Below is a code sample from the collision system I programmed for Mosh Pit. This sample shows the collision detection between two any-sided convex polygons. As per my implementation of the Separating Axis Theorem, I iterate through every normal vector of both polygons checking if there is a gap between the two polygons when I project all the points into one dimension. If there is no gap, I save the shortest penetration depth and other relative information for position correction and impulse-based collision resolution.

© 2021 Jared Joyal

Theme by Anders NorenUp ↑