Lesson 9 exemplar solution


I’m a tad troubled by the exemplar solution in one respect.

The low order (last 2, rightmost) 2 bits indicate: 00 shot, 01 miss, 10 hit, or 11 error. This means the target never says “I am sunk” in the protocol. So either players must talk - bad - or agree silently - also bad. Nor does this scale up to battleship with varying ship lengths. I would rather see 11 mean “sunk” and, if an error indicator is needed, add a bit.

[Edit: I had listed a second concern that was me being dense…]




I agree that this is a limitation of the protocol. I wonder if students would be able to see it and develop a better solution.

Happy computing,