My Work

A selection of projects I completed at 42 Silicon Valley. More projects can be found on github.

Fillit

Fillit is program written in C that efficiently finds the optimal solution to packing tetris pieces into the smallest square space possible. I use a recursive backtracking algorithm together with a series of optimizations based on piece shapes.

While working on the project I thought it would be interesting to see the algorithm in action, so I incorporated flags that activate a termial-based animation mode complete with multiple color schemes as well as choice of size and speed.

Reverse Game of Life Neural Network

The goal of Reverse Game of Life was to use machine learning techniques to accurately predict past board states in Conway's Game of Life, given the current state. My approach was to build a feed forward neural network module, as well as a parallel processing grid search algorithm to track results and fine-tune the hyperparameters of the network and prevent overfitting to the training data.

My neural network module was written in Python 3 and can be applied to other machine learning problems. It also can be provided with up to two evaluation data sets and will log the cost and accuracy on these data sets after each training epoch. After training with 200,000 data pieces for about 12 hours, my network was making predictions with about 87% accuracy.

Generation counter: 0

The Game of Life is played on a grid of square cells, each of which is either alive or dead. Every cell interacts with its eight neighbours, and at each step in time, the following transitions occur:

  1. Underpopulation: Any live cell with fewer than two live neighbours dies.
  2. Overpopulation: Any live cell with more than three live neighbours dies.
  3. Reproduction: Any dead cell with exactly three live neighbours becomes a live cell.
  4. Any live cell with two or three live neighbours lives on to the next generation.

Wolf3D

A lesson in the history of video games, Wolf3D is a first-person perspective game engine written in C. Worlds are created using a ray-casting technique, which creates 3D images from 2D numerical grids representing the positions and textures of walls, floors, ceilings, and sprites. While the graphics aren't state of the art, the technique really inspired me with its simplicity, efficiency and abilty to easily create or modify new worlds.

Squig

As a fully customizable random squiggly line module built using simple jQuery animations, Squig combines my love for geometry and useless things. The project came about as I was looking for a fun way to practice front-end web development skills.

Each squiggly line is an instance of the squig class, which is initiated with parameters to control its behvaior. A sequence of movements is generated using these parameters and a random number generator, and based on this sequence, hundreds of transparent divs are appended to the DOM at precise locations. These are then animated in succession so that their borders create the effect of a single line squigging across the screen.

Give it a go
Ray Tracer

Ray tracing is a technique for generating an image by tracing paths of light and simulating the effects of its encounters with virtual objects. My renderer was written in C and implemented using a bare-bones library that gave me only the ability to color single pixels. As features were added, I learned tons about optics and the behaviour of light, but also about techniques for approximating reality effciently.

It currently supports phong lighting, parallel and point light sources, interactive shadows, recursive reflections and refractions, and adaptive super sampling. Supported objects include planes, spheres, cones, cylinders, and parabaloids, which can all be rotated and positioned using intrinsic angles and can be made finite or concave by bounding with planes.

Ft_Fractal

Ft_Fractal is a program written in C that renders colorful fractal images that can be explored in real time. Supported fractals are "Mandelbrot", "Julia", "Burning Ship", and "Buddhabrot".

Fractals are essentially visual representations of complex sequences generated by repeated application of a complex function. Each pixel is colored according to how long it takes the pixel's associated complex sequence to converge. Shading is done by transforming a discrete color space to continuous one and using trigonometric functions to get a cyclic effect.

The p_thread multithreading library was used to speed up frame rendering time, which allows for smooth zooming despite incredibly high computational cost.

Ft_Database

Ft_Datebase is a command line database management system written in C that can be used to create, remove, update, and display user data.

No additional libraries were allowed, so all methods were written from scratch, including custom serialization and deserialization methods to efficiently store data, as well as a custom query language parser modeled after SQL. Other features include automatic table backup in case data is corrupted or lost, the ability to sort or display data based on multiple conditions, and the ability to restrict columns to a specifc data type.