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

  • SEARCH
  • Home
  • 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 9190523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:28:54+00:00 2026-06-17T20:28:54+00:00

I know that the title of this topic might be confusing, but I didn’t

  • 0

I know that the title of this topic might be confusing, but I didn’t know how to explain it in a single sentence!
I’ll try to be more clear, I have a 2d array of boolean values, every value states if that particular position (or block) is alive or not.

Let’s make an example:

1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1

This array contains 16 “alive” blocks, now I can “kill” some blocks, changing their state from 1 to 0.
What I would like to do is to know if after a “kill”, the group splits in two or more separate groups, for example:

1 1 0 1
1 1 0 1
0 1 0 1
1 1 1 1

This shape is still “intact”, since the group of 0 is not cutting any of the 1 groups, but in this case:

1 1 0 1
1 1 0 1
0 0 0 1
1 1 1 1

Now I’ve killed the only bit who was keeping all the 1 together, the shape has been divided in two smaller groups!
I’ve tried checking the neighbours of the last killed bit but then I can’t be sure of other possible connection of the shape.
I’ve also tried a pathfinding algorithm but this operation should be very fast and a pathfinding is too complex.
How can I achieve this?

  • 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-06-17T20:28:55+00:00Added an answer on June 17, 2026 at 8:28 pm

    Pick any of the alive blocks and do a flood-fill and then check if it got to all the other live blocks.

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

Sidebar

Related Questions

i didn't really know how to title this question, but here's a thing that
I know there are many topic that have the same title, but I've tried
I know that this topic is shown everywhere on SO, but I couldn't find
I know, I know. That way madness lies. The title refers to this great
Sorry if the title is not that specific, but I don't know how else
I know that this sort of question has been asked here before, but still
I know that title sounds crazy but here is my situation. After a certain
I know that title didn't make sense, Im sorry! Its hard to word what
I know the title of this question is stupid, but I couldn't come up
sorry for the title, i don't know what suitable title of this topic. I

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.