Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Clean up "magic string" cell color in Game of Life #15

Open
NicMcPhee opened this issue Dec 3, 2019 · 1 comment
Open

Clean up "magic string" cell color in Game of Life #15

NicMcPhee opened this issue Dec 3, 2019 · 1 comment

Comments

@NicMcPhee
Copy link
Member

In the Game of Life exercises, I used the "magic string" "blue" for the color of my circles, which then propagates out across the tests, etc., in an awkward way.

One option would be to add another named constant for that color instead of scattering the "magic string" "blue" all over the code.

Alternatively I could write a draw-cell function that encapsulates both "solid" and "blue" so they're only in one place.

@NicMcPhee
Copy link
Member Author

Or I could just define a variable cell that is the (circle cell-radius "solid" "blue") logic, which would probably be nicer than a draw-cell function. (Credit to Jackson Lennox for that idea.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant