Skip to content

Instantly share code, notes, and snippets.

@carlmjohnson carlmjohnson/ham.go
Last active Nov 10, 2016

Embed
What would you like to do?
package sudoku
const hammDist = [...]int{
0x000: 0,
0x002: 1,
0x004: 1,
0x006: 2,
0x008: 1,
0x00A: 2,
0x00C: 2,
0x00E: 3,
0x010: 1,
0x012: 2,
0x014: 2,
0x016: 3,
0x018: 2,
0x01A: 3,
0x01C: 3,
0x01E: 4,
0x020: 1,
0x022: 2,
0x024: 2,
0x026: 3,
0x028: 2,
0x02A: 3,
0x02C: 3,
0x02E: 4,
0x030: 2,
0x032: 3,
0x034: 3,
0x036: 4,
0x038: 3,
0x03A: 4,
0x03C: 4,
0x03E: 5,
0x040: 1,
0x042: 2,
0x044: 2,
0x046: 3,
0x048: 2,
0x04A: 3,
0x04C: 3,
0x04E: 4,
0x050: 2,
0x052: 3,
0x054: 3,
0x056: 4,
0x058: 3,
0x05A: 4,
0x05C: 4,
0x05E: 5,
0x060: 2,
0x062: 3,
0x064: 3,
0x066: 4,
0x068: 3,
0x06A: 4,
0x06C: 4,
0x06E: 5,
0x070: 3,
0x072: 4,
0x074: 4,
0x076: 5,
0x078: 4,
0x07A: 5,
0x07C: 5,
0x07E: 6,
0x080: 1,
0x082: 2,
0x084: 2,
0x086: 3,
0x088: 2,
0x08A: 3,
0x08C: 3,
0x08E: 4,
0x090: 2,
0x092: 3,
0x094: 3,
0x096: 4,
0x098: 3,
0x09A: 4,
0x09C: 4,
0x09E: 5,
0x0A0: 2,
0x0A2: 3,
0x0A4: 3,
0x0A6: 4,
0x0A8: 3,
0x0AA: 4,
0x0AC: 4,
0x0AE: 5,
0x0B0: 3,
0x0B2: 4,
0x0B4: 4,
0x0B6: 5,
0x0B8: 4,
0x0BA: 5,
0x0BC: 5,
0x0BE: 6,
0x0C0: 2,
0x0C2: 3,
0x0C4: 3,
0x0C6: 4,
0x0C8: 3,
0x0CA: 4,
0x0CC: 4,
0x0CE: 5,
0x0D0: 3,
0x0D2: 4,
0x0D4: 4,
0x0D6: 5,
0x0D8: 4,
0x0DA: 5,
0x0DC: 5,
0x0DE: 6,
0x0E0: 3,
0x0E2: 4,
0x0E4: 4,
0x0E6: 5,
0x0E8: 4,
0x0EA: 5,
0x0EC: 5,
0x0EE: 6,
0x0F0: 4,
0x0F2: 5,
0x0F4: 5,
0x0F6: 6,
0x0F8: 5,
0x0FA: 6,
0x0FC: 6,
0x0FE: 7,
0x100: 1,
0x102: 2,
0x104: 2,
0x106: 3,
0x108: 2,
0x10A: 3,
0x10C: 3,
0x10E: 4,
0x110: 2,
0x112: 3,
0x114: 3,
0x116: 4,
0x118: 3,
0x11A: 4,
0x11C: 4,
0x11E: 5,
0x120: 2,
0x122: 3,
0x124: 3,
0x126: 4,
0x128: 3,
0x12A: 4,
0x12C: 4,
0x12E: 5,
0x130: 3,
0x132: 4,
0x134: 4,
0x136: 5,
0x138: 4,
0x13A: 5,
0x13C: 5,
0x13E: 6,
0x140: 2,
0x142: 3,
0x144: 3,
0x146: 4,
0x148: 3,
0x14A: 4,
0x14C: 4,
0x14E: 5,
0x150: 3,
0x152: 4,
0x154: 4,
0x156: 5,
0x158: 4,
0x15A: 5,
0x15C: 5,
0x15E: 6,
0x160: 3,
0x162: 4,
0x164: 4,
0x166: 5,
0x168: 4,
0x16A: 5,
0x16C: 5,
0x16E: 6,
0x170: 4,
0x172: 5,
0x174: 5,
0x176: 6,
0x178: 5,
0x17A: 6,
0x17C: 6,
0x17E: 7,
0x180: 2,
0x182: 3,
0x184: 3,
0x186: 4,
0x188: 3,
0x18A: 4,
0x18C: 4,
0x18E: 5,
0x190: 3,
0x192: 4,
0x194: 4,
0x196: 5,
0x198: 4,
0x19A: 5,
0x19C: 5,
0x19E: 6,
0x1A0: 3,
0x1A2: 4,
0x1A4: 4,
0x1A6: 5,
0x1A8: 4,
0x1AA: 5,
0x1AC: 5,
0x1AE: 6,
0x1B0: 4,
0x1B2: 5,
0x1B4: 5,
0x1B6: 6,
0x1B8: 5,
0x1BA: 6,
0x1BC: 6,
0x1BE: 7,
0x1C0: 3,
0x1C2: 4,
0x1C4: 4,
0x1C6: 5,
0x1C8: 4,
0x1CA: 5,
0x1CC: 5,
0x1CE: 6,
0x1D0: 4,
0x1D2: 5,
0x1D4: 5,
0x1D6: 6,
0x1D8: 5,
0x1DA: 6,
0x1DC: 6,
0x1DE: 7,
0x1E0: 4,
0x1E2: 5,
0x1E4: 5,
0x1E6: 6,
0x1E8: 5,
0x1EA: 6,
0x1EC: 6,
0x1EE: 7,
0x1F0: 5,
0x1F2: 6,
0x1F4: 6,
0x1F6: 7,
0x1F8: 6,
0x1FA: 7,
0x1FC: 7,
0x1FE: 8,
0x200: 1,
0x202: 2,
0x204: 2,
0x206: 3,
0x208: 2,
0x20A: 3,
0x20C: 3,
0x20E: 4,
0x210: 2,
0x212: 3,
0x214: 3,
0x216: 4,
0x218: 3,
0x21A: 4,
0x21C: 4,
0x21E: 5,
0x220: 2,
0x222: 3,
0x224: 3,
0x226: 4,
0x228: 3,
0x22A: 4,
0x22C: 4,
0x22E: 5,
0x230: 3,
0x232: 4,
0x234: 4,
0x236: 5,
0x238: 4,
0x23A: 5,
0x23C: 5,
0x23E: 6,
0x240: 2,
0x242: 3,
0x244: 3,
0x246: 4,
0x248: 3,
0x24A: 4,
0x24C: 4,
0x24E: 5,
0x250: 3,
0x252: 4,
0x254: 4,
0x256: 5,
0x258: 4,
0x25A: 5,
0x25C: 5,
0x25E: 6,
0x260: 3,
0x262: 4,
0x264: 4,
0x266: 5,
0x268: 4,
0x26A: 5,
0x26C: 5,
0x26E: 6,
0x270: 4,
0x272: 5,
0x274: 5,
0x276: 6,
0x278: 5,
0x27A: 6,
0x27C: 6,
0x27E: 7,
0x280: 2,
0x282: 3,
0x284: 3,
0x286: 4,
0x288: 3,
0x28A: 4,
0x28C: 4,
0x28E: 5,
0x290: 3,
0x292: 4,
0x294: 4,
0x296: 5,
0x298: 4,
0x29A: 5,
0x29C: 5,
0x29E: 6,
0x2A0: 3,
0x2A2: 4,
0x2A4: 4,
0x2A6: 5,
0x2A8: 4,
0x2AA: 5,
0x2AC: 5,
0x2AE: 6,
0x2B0: 4,
0x2B2: 5,
0x2B4: 5,
0x2B6: 6,
0x2B8: 5,
0x2BA: 6,
0x2BC: 6,
0x2BE: 7,
0x2C0: 3,
0x2C2: 4,
0x2C4: 4,
0x2C6: 5,
0x2C8: 4,
0x2CA: 5,
0x2CC: 5,
0x2CE: 6,
0x2D0: 4,
0x2D2: 5,
0x2D4: 5,
0x2D6: 6,
0x2D8: 5,
0x2DA: 6,
0x2DC: 6,
0x2DE: 7,
0x2E0: 4,
0x2E2: 5,
0x2E4: 5,
0x2E6: 6,
0x2E8: 5,
0x2EA: 6,
0x2EC: 6,
0x2EE: 7,
0x2F0: 5,
0x2F2: 6,
0x2F4: 6,
0x2F6: 7,
0x2F8: 6,
0x2FA: 7,
0x2FC: 7,
0x2FE: 8,
0x300: 2,
0x302: 3,
0x304: 3,
0x306: 4,
0x308: 3,
0x30A: 4,
0x30C: 4,
0x30E: 5,
0x310: 3,
0x312: 4,
0x314: 4,
0x316: 5,
0x318: 4,
0x31A: 5,
0x31C: 5,
0x31E: 6,
0x320: 3,
0x322: 4,
0x324: 4,
0x326: 5,
0x328: 4,
0x32A: 5,
0x32C: 5,
0x32E: 6,
0x330: 4,
0x332: 5,
0x334: 5,
0x336: 6,
0x338: 5,
0x33A: 6,
0x33C: 6,
0x33E: 7,
0x340: 3,
0x342: 4,
0x344: 4,
0x346: 5,
0x348: 4,
0x34A: 5,
0x34C: 5,
0x34E: 6,
0x350: 4,
0x352: 5,
0x354: 5,
0x356: 6,
0x358: 5,
0x35A: 6,
0x35C: 6,
0x35E: 7,
0x360: 4,
0x362: 5,
0x364: 5,
0x366: 6,
0x368: 5,
0x36A: 6,
0x36C: 6,
0x36E: 7,
0x370: 5,
0x372: 6,
0x374: 6,
0x376: 7,
0x378: 6,
0x37A: 7,
0x37C: 7,
0x37E: 8,
0x380: 3,
0x382: 4,
0x384: 4,
0x386: 5,
0x388: 4,
0x38A: 5,
0x38C: 5,
0x38E: 6,
0x390: 4,
0x392: 5,
0x394: 5,
0x396: 6,
0x398: 5,
0x39A: 6,
0x39C: 6,
0x39E: 7,
0x3A0: 4,
0x3A2: 5,
0x3A4: 5,
0x3A6: 6,
0x3A8: 5,
0x3AA: 6,
0x3AC: 6,
0x3AE: 7,
0x3B0: 5,
0x3B2: 6,
0x3B4: 6,
0x3B6: 7,
0x3B8: 6,
0x3BA: 7,
0x3BC: 7,
0x3BE: 8,
0x3C0: 4,
0x3C2: 5,
0x3C4: 5,
0x3C6: 6,
0x3C8: 5,
0x3CA: 6,
0x3CC: 6,
0x3CE: 7,
0x3D0: 5,
0x3D2: 6,
0x3D4: 6,
0x3D6: 7,
0x3D8: 6,
0x3DA: 7,
0x3DC: 7,
0x3DE: 8,
0x3E0: 5,
0x3E2: 6,
0x3E4: 6,
0x3E6: 7,
0x3E8: 6,
0x3EA: 7,
0x3EC: 7,
0x3EE: 8,
0x3F0: 6,
0x3F2: 7,
0x3F4: 7,
0x3F6: 8,
0x3F8: 7,
0x3FA: 8,
0x3FC: 8,
0x3FE: 9,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.