Translating My 2048 Strategy Into A.I. Code

2048 game over

Soon after joining the 2048 craze, I was able to consistently reach the 2048 tile and was ready to begin my pursuit of the 4096 tile to truly prove my skill. However, I quickly grew tired of the tedious task of quickly and repeatedly selecting the right direction and got frustrated with my flawed mushy human brain slipping up. Having never done any kind of game A.I., I decided 2048 would be the perfect game to try my hand at it, so I downloaded the source code and got cracking.

Continue reading

Light Painting with an Arduino and RGB LED light strip

Light painting is an easy and fun activity to do with friends and any camera that has shutter speed control.  After playing around with this a few times, I wanted to take it to the next level, and stumbled upon someone’s very informational post.  It became my goal to make this happen, as cheaply and simply as possible of course.  Being in possession of an Arduino Uno, I just had to acquire a few more components and write up some easy code (with the help of some libraries) to be able to make a picture like this:

Megaman light painting

Continue reading

Trying out A* Pathfinding

Pathfinding is an integral part of many top-down games, especially RTS games like Starcraft or Age of Empires, in which you tell a unit where to go, and it figures out the best way to get there itself, navigating around obstacles and unwalkable spaces.  A proven way of doing efficient and accurate pathfinding is using the A* search algorithm.  After doing some tutorials on C++ and SDL, I thought I’d give it a shot.  After getting some free-to-use art from, I came up with the following:

Continue reading

Two-disk Hypotrochoid Generator in Python

After picking up a little spirograph kit at the dollar store and playing around with it for a while, I wondered what it would be like if a second disk could rotate around the first disk. This not being physically possible, I decided it’d be a good time to practice my Python as well. After a couple evenings of fiddling, I was able to come up with some nice-looking images using just the math library and Python Imaging Libary.

Here’s the first image that was successfully generated. I stopped drawing prematurely so there are gaps, and the simulated disk was actually rotating the opposite way than a physical spirograph disk would.

hypotrochoid 1

Continue reading