Q: Can we assume that there are no duplicate values in each of the left and right "sets"?
A: Yes. As two examples, you'll never see a file like this,
A:1
A:2
or this:
A:1
B:1
Q: My xfield.rb has more bugs than macOS! What sort of debugging tools has Ruby got?
A: For some simple things, see
Ruby Debugging.
Q: What's the printf format I should use to get a line like 4 correct in 7 guesses = 57.1%?
A:printf("%d correct in %d guesses = %.1f%%\n", ...) Note that the doubled percent sign produces a single percent sign of output.
Clarifications
None yet!
Corrections
The write-up doesn't specify how to handle the case of no guesses, which occurs if the user enters "/u"
immediately. Do this: