Technology faculty continually look for ways to combine coursework with real world applications. For example, at the end of the semester of Scripting II (CS 115), students are tasked with creating a program that solves, or can be applied, to a real world problem. SITC students Matthew Middlebrook and Brighton Mica decided to create a program that could beat the game Minesweeper. Minesweeper is a single-player puzzle video game where the objective of the game is to clear a rectangular board containing hidden mines or bombs without detonating any of them. Players receive help from clues about the number of neighboring mines in each field.
As you can imagine, this was no easy task as they set out to beat a computer at a game that is difficult for most people to win. Middlebrook and Mica had some doubt at the beginning of their endeavor, due to the sheer amount of work involved and wondering if it could even be done in the scripting language. However, using the tools they hadlearned from Scripting such as lists to store the game board, complex functions, and if statements they were able to start planning out a program.
After making the decision to go forward with the Minesweeper program as their final project they each began to brainstorm on possible ways to accomplish this task. Both students came up with ideas on how to solve the problem in different ways, based on ways they thought the game could be beat. Mica’s solution was to try and find the location of the items (numbers, blank spaces, and bombs) on the board by using r
eference images. While the solution did work correctly and was very accurate, it turned out to be a very slow method. Middlebrook’s solution was to get the coordinates of the game window and use some math to try and figure out where the spaces on the board were located. It took a long time to compile and figure out the correct positioning of everything, but this method turned out to be the fastest. Even though this idea was much more prone to error, especially if the window moved or resized, the pair decided to go the route of the most efficient method. Because this was such a complex program, the students also had to teach themselves some things that had not yet been covered in classes, such as opening a program. Through this research they learned enough to be able to write a working code.
Mica and Middlebrook were able to write the program and win the game a majority of the time in around 2-3 seconds. Writing such a complex program was well beyond what was expected but the pair says they were inspired by the difficulty of the game and wanted to find a way to beat Minesweeper, achieving their goal and presenting an excellent final project for Scripting.