How to Code Insertion Sort in Java

I haven’t written in awhile. I decided that I’m going to continue my tutorials on data structures, so next up is learning how to code an insertion-sort algorithm in Java. I have a graphic pictured below that shows how this insertion-sort algorithm works.

insertionSortPicture

What you see pictured above is the execution of the insertion-sort algorithm. This algorithm basically loops through a list of items, it could be any comparable data type....


Install Flipping Gravity!

Download

My first app! It’s been awhile, and I just finished a big course in Unity and developing apps, it was a great course and taught me a lot. You can download the game for the app on google play here, and I will release it on the Apple Store in the future. In the mean time, here’s a limited version for PC.

Windows

You can download the game here at

Download Tetris

Download

To download simply right click the link below and save it onto you computer. Make sure you have Java installed, then click into the tetris folder until you find the Tetris.jar. Double click this file to play.

Tetris.zip (159.3kB)

Background

Now Tetris was a big leap for me. Never before had I attempted to build something so manipulating, and soon I would build an even more complex game called the impossible...


Download Snake!

Download

To download simply right click the link below and save it onto you computer. Make sure you have Java installed, and then click the downloaded file to play!

Snake.jar (95.1kB)

Background

Everyone loves Snake! This game was a bit of a doozy for me, it took me a little bit to finally figure out how to make my snake work. Another hard part of getting the game to work was finding...


My First Version of Pong in Java

Download

To download simply right click the link below and save it onto you computer. Make sure you have Java installed, and then click the downloaded file to play!

Pong.jar (15.8kB)

Background

This is one of the first games I programmed in Java. It is not my first game, I have created several. But, whenever I begin game coding in a new language, or using a new platform, Pong is always a...


Install My First Box Collision Test

Download

To download simply right click the link below and save it onto you computer. Make sure you have Java installed, and then click the downloaded file to play!

Minigame.jar (4.8kB)

How it Works

Here’s my first attempt at box collision in Java. I was inspired to create a simple 2D platformer with some very simple physics and this is what came of it. I hope you enjoy it. While you’re looking...


Install the Impossible Game

Here’s a game that I coded from scratch. Follow the download instructions below to install on your computer.

Instructions

Download and unzip the Main.zip file linked below, then double-click or run the jar from the command line :)

Note: I did not come up with the idea for The Impossible Game, all credit to the idea goes to the creators of the original, World’s Hardest Game. My game is simply a remake...


How to Program a Deque in Java

Deques are another important data structure. They are like queues, except that they are double ended. What this means is that you can add an element to the front of the deque, or to the end of the deque. It also means you can remove an element from the front of a deque or the end of a deque. Now, this is very efficient, it is O(1). The only hindrance is that it is limited...


How to Program a Queue in Java

Queues are very similar to deques. The only difference is they follow the First in First Out (FIFO) principle. This means that they add the newest elements to the back of the list, and the oldest elements get returned first. It’s kind of like waiting in line at a fast food restaurant. If you pull in and their is a long line, you are the newest person there, but you are added to the end...


How to Program a Stack in Java

Stacks are a fundamental structure that we use everyday. Have you ever pressed the undo button? How about this website your reading? These and more all use stacks to help build their structures. The stacks are used to help parse code, or just hold the most recent value. In this post I would like to go over what a stack is and how to code it in Java. I am going to implement it using...