Skip to content

DO NOT MERGE: Quickly hack up the 'count of unique 4-connected islands' solution#19

Open
boingoing wants to merge 1 commit intomainfrom
count_islands
Open

DO NOT MERGE: Quickly hack up the 'count of unique 4-connected islands' solution#19
boingoing wants to merge 1 commit intomainfrom
count_islands

Conversation

@boingoing
Copy link
Owner

Instead of playing JezzBall, this build provides a solution for finding the count of 4-connected islands in the playfield.

Each playfield byte can initially be 0 (WATER) or 1 (LAND).

The game launches directly to the playfield and doesn't contain balls or player sprites. Press A to solve the playfield.

CLEAR% in the HUD will display the count of islands found.

Each discovered island will be marked with a unique number (>1).

This works by walking over every playfield tile, skipping water tiles and already-discovered land tiles, and upon finding an undiscovered land tile, walking the entire island connected to that origin land tile and marking the island by setting the tiles comprising it with a unique number (>1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant