This Website Lead Tracker Demo Python Game JavaScript Particle Sim C++ Embedded Design
Lead Tracker
Contact Info Certifications Resume LinkedIn

Demos▸​
5. C++

This page shows a selection of some of my more interesting projects using C++. Some of these were created for the purpose of a class project and others were just the result of me playing around and experimenting on my own.

Bangerang

This game was the final project of a class (CAP4730: Computational Structures in Computer Graphics) I took in 2008 that taught computer modeling/graphics with a focus on OpenGL. Actually, it was a team project, but I lost the final product, so only my part of the game is included here, which includes the basic physics engine and controls.

Other weapons like the missiles mentioned below are missing. It's also missing the networking feature that allows the 2nd player to join in on their own screen. And finally, all the cool (I assume) graphics are missing, so everything is just simple polygons covered in simple textures.

However, what remains is still pretty fun. The style engine is also included, so you can zoom around doing tricks and beating the hell out of your idle opponent :)

Gameplay

The main goal of Bangerang is to knock your opponent out of the arena. The more damage that you take, the farther you will go flying when you are attacked, making it easier for you to get knocked out. Each car is armed with a basic tackle accelerator that can give the car a short burst of speed when activated. Don’t use it recklessly though, because every time you try to tackle and miss there will be about a one second cooldown where your car will come to a stop and not move, making you an easy target. Also remember that getting hit in the back does twice the damage as a side collision, and getting hit in the front does almost no damage at all. To add to the mayhem, missiles and mines have been added to the arena to help you blast your opponent away. However, you won’t just be handed these amazing weapons. Instead you’ll need to earn them by doing cool tricks in the arena such as jumping over gaps or doing spins in the air. Only by mastering the arena will you truly be able to master Bangerang.

The demo video here shows the tricks E.T. (soaring over the center mound) and Return to the Beginning (jump from the top ramps back to the center starting mound). See if you can discover the other tricks: Cutting Corners, Straight to the Ramp, and Jump to the Mound.

Controls

  • A, D ➜ Turn left/right, respectively.
  • W, S ➜ Accelerate/decelerate, respectively.
  • J ➜ Jump.
  • Space ➜ Lunge forward to attack.

Cannons

Cannons was actually the result of the 1st major assignment from the same CAP4730 class mentioned above. It served as a simple way to demonstrate our abilities to perform basic linear transformations (e.g., translate, scale, rotate).

You can download the code off GitHub here.

Gameplay

Cannons is based on an old game called Gorillas that I used to play back in the early 90s on my dad's PC. It's a 2-player game, where each player has a cannon and they take turns trying to shoot at the other player's cannon. On each player's turn they can choose their firing angle and firing power before shooting their cannon and watching the result. If you miss, then watch the cannon ball's trajectory to see what you should correct on your next turn. If you hit the other player, then you get a point and the arena will reset to a new layout for a new round.

Controls

  • A, D ➜ Adjust the angle counter-clockwise/clockwise, respectively.
  • W, S ➜ Increase/decrease the power, respectively.
  • Space ➜ Fire.
  • P ➜ Pause the game and see instructions

Chess

In Fall of 2008, I was reading about the basic min/max algorithm behind simple Chess AIs and decided that I'd like to give it a try. I designed the basic AI algorithm in C++ and created a simple command-shell text-based interface where the state of the board could be "drawn" each turn and player input could be captured.

Although the initial product was interesting, I really wanted to see an actual chess board instead of the clunky text-based display, so I brought the code into Microsoft's XNA environment (for video-game development), which required me to port everything to C#

I completed the new board display GUI, and added basic controls to allow the user to advance the AIs forward and review past plays, but I stopped working on it before I added human controls. So, for now, the GUI-enhanced version only allows play between 2 AIs.

You can download the project off GitHub here, which contains the main GUI-enhanced version (with Visual Studio project for experimenting with or standalone package for playing right away) and the original text-based version that still allows human play.

Sudoku

In the Spring of 2006, I discovered Sudoku and became addicted. But after a couple months of working the same logic over and over, I became a bit bored with the routine, and I realized that I could codify my understanding in a program that would solve all Sudokus automatically for me. A few days later, I had completed the program shown here, and after using it to solve the hardest Sudokus I could find, I decided sudokus aren't so interesting anymore. If you also want to ruin the fun of solving Sudokus, you can download the solver off GitHub here.

So how good is it actually? I tested it recently on a few Sudokus that I found that were rated "Hard", but the program usually solved them in under a few ms. Then I found this puzzle, which was developed by some Finnish mathematician Inkala and which ABC News declared as the "Hardest-Ever Sudoku". I kinda figured this might be fake news at first, but I couldn't even fill in a single digit after staring at it for a couple minutes. So how did the solver do? You can see the results at the bottom of the image on the left. It took less than a quarter of a second. Not too bad.

On a related tangent, if you used to like Sudokus like me, but now also find them boring, the YouTube channel Cracking The Cryptic has a ton of great Sudoku-like puzzles for you to try. They're Sudoku-like because they're generally similar to normal Sudokus but with added twists and special rules, so the puzzles feel similar, but require novel insights as well. They even provide a link to a Sudoku-input tool with the specific puzzle pre-loaded so you don't need to draw it out yourself on paper, and the YouTube video shows someone solving it in real-time so you can see how a pro does it.

Miscellaneous Utilities

Project Euler badge showing how many problems I've currently solved.

For several months in 2010, I became interested in solving problems on Project Euler, a site which hosts hundreds of challenging problems that require programming and math skills to solve. As I solved more problems, I kept seeing similar themes (e.g., manipulation of really large numbers, analysis of factors, rearrangement of digits), so I created this C++ utilities library to help me handle these types of problems more quickly. Unfortunately, once I created this library, the problems I originally wanted to solve seemed less interesting, so I moved on to other things, leaving my total score relatively low. After digging up my old C++ projects though and remembering how interesting these problems could be (like this hard one I recently solved), I might start putting this library back to good use.

Navigator
Table of Contents
Table of Contents