Files
rose-ash/lib/ocaml
giles 37a514d566
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
ocaml: phase 5.1 gray_code.ml baseline (4-bit reflected Gray code, sum+len = 136)
Single-formula generation:

  gray[i] = i lxor (i lsr 1)

For n = 4, generates 16 values, each differing from its neighbour
by one bit. Output is a permutation of 0..15, so its sum equals the
natural-sequence sum 120; +16 entries -> 136.

Tests lsl / lxor / lsr together (the iter-127 bitwise ops) plus
Array.make / Array.fold_left.

95 baseline programs total.
2026-05-09 19:08:19 +00:00
..