NickGraeff / minesweeper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minesweeper

Exactly as the title says. It was the end of summer and I felt hopeless not having built anything real up to that point when I noticed that minesweeper was no longer built into Windows. I figured "I could build that" and I did. Because it uses the SFML library, it's "supposed" to work on all platforms so long as you have that library installed. I've tested it on Windows and Linux but getting it to work on Windows requires a tutorial to install the library. For Ubuntu Linux just type sudo apt-get install libsfml-dev and the library should download just fine. Then just run make and the executable for the game should work.

Flood-fill Algorithm

This was the first application I built right after taking my Data Structures and Algorithms class. I wanted to put my skills to use so I started by building a class and everything that goes along with creating a data structure. Near the completion of the project I realized I wasn't actually completed because in Minesweeper when you click on a tile with no mines around it, it automatically uncovers all surrounding tiles with the same condition. I figured I could handle that. That would just require a depth first search (or breadth, but I liked depth better at the time) to the surrounding blocks to see if they were also not near a mine. That was the final step and suddenly I had a game up and running. Later on I found out this specific usage of DFS was called the flood-fill algorithm.

About


Languages

Language:C++ 89.2%Language:Makefile 10.8%