Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6617923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:45:44+00:00 2026-05-25T20:45:44+00:00

I am working on a minesweeper program in Java. I have my bombs distributed

  • 0

I am working on a minesweeper program in Java. I have my bombs distributed throughout the field, and I have my actionlisteners responding to clicks and mouselistener, responding to right clicks. I also have each square that is clicked check to see how many bombs are adjacent to it and print the number on the square just like in the game.

The only part I don’t understand is how minesweeper opens up field when clicking a square whether it be a number or a blank square. Please help me understand how this works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:45:45+00:00Added an answer on May 25, 2026 at 8:45 pm

    The only part I don’t understand is how minesweeper opens up field when clicking a square whether it be a number or a blank square.

    If any of its neighboring squares has a mine, it will show a number with the number of mines around it.

    It’s blank if there are no mines around it (ie: it would show the number 0 if it had to). When it’s blank it also recursively opens all its neighbors (eg: opens all neighbors and their neighbors if they are blank too, and so forth).

    And if it’s a mine you lose of course. An example:

    X 2 . .
    X 2 . .
    2 2 1 .
    1 X 1 .
    

    (let X denote a mine).

    If you open any of the squares with marked as . (blank), automatically expand all of them and the numbers next to them:

    - 2 . .
    - 2 . .
    - - 1 .
    - - 1 .
    

    (let - denote a hidden square).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been busy working on a program that can solve Minesweeper puzzles (for no
I am trying to write a Minesweeper clone in Java for fun. I have
Working with some basic java apps on CentOS 5 linux and I have my
I am working on a Minesweeper which I have pretty much complete. The only
Working on a project at the moment and we have to implement soft deletion
Working with Visual Studio (I'm using 2008) I have started to notice that when
working with iis7. project is in Integrated Pipelinemodus Application Pool is : DefaultAppPool have
Working in Office 2007, I'd like to add a filename field in my document
Working on site development using Drupal. Using View module also. I did defined severar
Working with C#. I have an abstract class that I use to read/write settings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.