You are browsing as a guest. Sign up (or log in) to start making projects!

Minesweeper

  • 3 Devlogs
  • 4 Total hours

A randomized minesweeper game you can play in the VS Code terminal.

Ship #1

Here it is, my Minesweeper game!

Function:
This game plays straight in your Java terminal. You are given instructions, choose the size of your game board, then use coordinates to place flags, weed out mines, and use logic to clear the whole board.

There are three main ways to play this game:
- Download the .zip file from the github release, unzip it, and double click on the application file within it.
- Download the .java file from the github project files or release files and open it using VS Code.
- Use the demo links through CodeHS to play, though it can be a bit glitchy and slow. The links are also in github, in the README and in the release description.

I recommend the VS Code route, it's just the easiest.

Summary of logic:
When you give the program the coordinate you wish to play, it uses a basic recursive flood fill to fill all adjacent tiles with no mines nearby. After you choose and it fills, it can either stop the program because you hit a mine, or it will continue until the number of mines on the board matches the number of unchecked tiles, meaning that you found all the mines.

Challenges:
Still the hardest thing of either of these was figuring out how to turn the .java file into a .zip that can run without downloading all of Java. The hardest challenge with this game specifically was probably making all of the checks that make sure your input is valid because there were a lot of cases to consider and even so I probably missed one which will be caught somewhere along the way.

  • 3 devlogs
  • 4h
  • 2.50x multiplier
Try project → See source code →
Open comments for this post

1h 54m 48s logged

After I ironed out a few bugs with the fill system, I worked on the actual game part where the user inputs the spaces on the board they would like to play and I think it is working how it should now. As an improvement from the last game, the maze game, that I made, I added instructions at the beginning and I used the built in Java colors to make the whole thing look a bit better. I am much happier with this game than the last and I think it is even more fun to play. The mechanism was a bit easier to code.

0
0
23

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…