Look into refactoring the passing of arrays #17

Closed
opened 2025-01-27 11:39:02 +01:00 by sacha · 1 comment
Owner

From: https://mastodon.nl/@0xZogG@hachyderm.io/113897461146920302

not sure why you pass each row instead of using arrays for example

From: https://mastodon.nl/@0xZogG@hachyderm.io/113897461146920302 > not sure why you pass each row instead of using arrays for example
Author
Owner

I am looking into this comment.

First instance is:

This eventually calls:

Which finally call down the line:

Looking at it, I never really pass arrays. I pass values in said arrays. But this is the blocks arrays which forms a reference to all possible rows. I could make this look nicer by chucking them all 9 references/indexes into an array, and unpacking it in the function being called.

Looking at https://go.dev/doc/effective_go#functions and https://go-proverbs.github.io/, I think I'm good.

I am looking into this comment. First instance is: - https://gitea.ligthert.net/golang/sudoku-funpark/src/branch/trunk/solver/processing.go#L74 This eventually calls: - https://gitea.ligthert.net/golang/sudoku-funpark/src/branch/trunk/solver/processing.go#L91 Which finally call down the line: - https://gitea.ligthert.net/golang/sudoku-funpark/src/branch/trunk/solver/processing.go#L187 - https://gitea.ligthert.net/golang/sudoku-funpark/src/branch/trunk/solver/stash.go#L7-L20 Looking at it, I never really pass arrays. I pass values in said arrays. But this is the `blocks` arrays which forms a reference to all possible rows. I could make this look nicer by chucking them all 9 references/indexes into an array, and unpacking it in the function being called. Looking at https://go.dev/doc/effective_go#functions and https://go-proverbs.github.io/, I think I'm good.
sacha closed this issue 2025-01-27 19:55:31 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: golang/sudoku-funpark#17
No description provided.