Assignment 5 FAQs, Clarifications and Corrections

FAQs

  1. 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
    
  2. 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.
  3. 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

  1. The write-up doesn't specify how to handle the case of no guesses, which occurs if the user enters "/u" immediately. Do this:
    $ ruby flash.rb a5/hexlets.fc 
    B? /u
    Done!
    
    No guesses!
    
    Never answered:
    A: 10
    B: 11
    C: 12
    D: 13
    E: 14
    F: 15
    

Typos (corrected in a5.html)

  1. The "a5" at the end of the following line was spurious:
    $ ruby xfield.rb -s. A 1 B C 2 D 3 E  < a5/xf.2a5