Skip to content

Feat: Add wrap and neighbor access methods for grid logic#36

Open
HossamSaberr wants to merge 2 commits intopharo-containers:masterfrom
HossamSaberr:feature-wrap-neighbors
Open

Feat: Add wrap and neighbor access methods for grid logic#36
HossamSaberr wants to merge 2 commits intopharo-containers:masterfrom
HossamSaberr:feature-wrap-neighbors

Conversation

@HossamSaberr
Copy link
Contributor

This PR implements the boundary and adjacency logic.

  • Wrapping: Added atColumnWrap:atRowWrap: and atColumnWrap:atRowWrap:put: to allow seamless boundary wrapping using 1-based modulo arithmetic.

  • Neighbors: Added neighborsAtColumn:atRow: to safely fetch up to 8 surrounding valid elements without out-of-bounds errors.

  • Testing: Added tests in CTArray2DTest covering normal access, edge wrapping and a full 8-neighbor.

  • Fixes About wrap and neighbors #17

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.

About wrap and neighbors

1 participant